From 4839168bbf68f3e2bcc99d5bfee616695adaa426 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Sat, 12 May 2018 07:58:27 -0700 Subject: [PATCH] Even simpler automap icons. Fix big string generation problem. --- .../src/org/badvision/A2PackPartitions.groovy | 23 ++++++++++++------- .../Apple/virtual/src/plasma/gameloop.pla | 8 +++---- Platform/Apple/virtual/src/plasma/party.pla | 4 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy b/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy index baae9d05..a81f901c 100644 --- a/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy +++ b/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy @@ -415,7 +415,7 @@ class A2PackPartitions smBuf.put((byte)0) // placeholder for hi bits int hibits = 0 def pixBuf, inv - // Keep automap icons very simple - no dither/column/row detection + // Keep automap icons very simple - no dither/column/row detection, just upper-left portion boolean keepSimple = (imgEl.@category.equalsIgnoreCase("automap")) for (int y = 0; y < 16; y += 2) { @@ -425,8 +425,10 @@ class A2PackPartitions { pixBuf = [:] inv = 1 - addTilePix(pixBuf, hibitBuf, rows[y] [x]) - if (!keepSimple) { + if (keepSimple) + addTilePix(pixBuf, hibitBuf, rows[y>>1][x>>1]) + else { + addTilePix(pixBuf, hibitBuf, rows[y] [x]) addTilePix(pixBuf, hibitBuf, rows[y+1][x]) if (x < 6) { addTilePix(pixBuf, hibitBuf, rows[y] [x+1]) @@ -3229,13 +3231,16 @@ end def genWeapon(func, row, out, strings) { + assert strings[parseStringAttr(row, "weapon-kind")] != null + assert strings[parseStringAttr(row, "ammo-kind")] != null + assert strings[parseStringAttr(row, "combat-text")] != null out.println( " return makeWeapon_pt2(makeWeapon_pt1(" + "${escapeString(parseStringAttr(row, "name"))}, " + - "${strings[parseStringAttr(row, "weapon-kind")]}, " + + "@${strings[parseStringAttr(row, "weapon-kind")]}, " + "${parseWordAttr(row, "price")}, " + "${parseModifier(row, "bonus-value", "bonus-attribute")}, " + - "${strings[parseStringAttr(row, "ammo-kind")]}, " + + "@${strings[parseStringAttr(row, "ammo-kind")]}, " + "${parseByteAttr(row, "clip-size")}, " + "${parseDiceAttr(row, "melee-damage")}, " + "${parseDiceAttr(row, "projectile-damage")}), " + @@ -3243,7 +3248,7 @@ end "${parseByteAttr(row, "semi-auto-shots")}, " + "${parseByteAttr(row, "auto-shots")}, " + "${parseByteAttr(row, "range")}, " + - "${strings[parseStringAttr(row, "combat-text")]}, " + + "@${strings[parseStringAttr(row, "combat-text")]}, " + "${parseBooleanAttr(row, 'single-use')})") } @@ -3252,7 +3257,7 @@ end out.println( " return makeArmor(" + "${escapeString(parseStringAttr(row, "name"))}, " + - "${strings[parseStringAttr(row, "armor-kind")]}, " + + "@${strings[parseStringAttr(row, "armor-kind")]}, " + "${parseWordAttr(row, "price")}, " + "${parseByteAttr(row, "armor-value")}, " + "${parseModifier(row, "bonus-value", "bonus-attribute")})") @@ -3270,7 +3275,7 @@ end if ("$kind, $modifier, $count, $storeAmount, $lootAmount" != ", NULL, 0, 0, 0") out.println(" return makeFancyItem(${escapeString(name)}, $price, " + - "${strings[kind]}, $modifier, $count, $storeAmount, $lootAmount)") + "@${strings[kind]}, $modifier, $count, $storeAmount, $lootAmount)") else out.println(" return makePlainItem(${escapeString(name)}, $price)") } @@ -3281,6 +3286,8 @@ end def str = parseStringAttr(row, attr) if (str) strings[str] = "_SI_${humanNameToSymbol(str, true)}" + else + strings[str] = "S_EMPTY" } } diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index 948a63e7..fabb520e 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -2978,14 +2978,14 @@ end /////////////////////////////////////////////////////////////////////////////////////////////////// // Load the Party engine and show data for the given player def showPlayerSheet(num)#1 - word pItemToUse, oldFlg + word sNameToUse, oldFlg if num+1 > countList(global=>p_players); beep; return 0; fin - pItemToUse = loadEngine(MOD_PARTY)=>party_showPlayerSheet(num) + sNameToUse = loadEngine(MOD_PARTY)=>party_showPlayerSheet(num) returnFromEngine(TRUE) // General 'use' handled here in case it triggers graphical effects - if pItemToUse + if sNameToUse anyInteraction = FALSE - scriptEvent(@S_USE, pItemToUse=>s_name) + scriptEvent(@S_USE, sNameToUse) if !anyInteraction scriptDisplayStr("Nothing happened.") textClearCountdown = 3 diff --git a/Platform/Apple/virtual/src/plasma/party.pla b/Platform/Apple/virtual/src/plasma/party.pla index 365ff5e2..81880039 100644 --- a/Platform/Apple/virtual/src/plasma/party.pla +++ b/Platform/Apple/virtual/src/plasma/party.pla @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2015-17 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1 +// Copyright (C) 2015-18 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1 // (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at . // Unless required by applicable law or agreed to in writing, software distributed under @@ -555,7 +555,7 @@ def doUse(player, item)#1 pause(800) return NULL fin - return item // general 'use' handled by outer engine, because it might involve graphics + return item=>s_name // general 'use' handled by outer engine, because it might involve graphics end // Select an item and drop it. Returns TRUE if anything changed