Even simpler automap icons. Fix big string generation problem.

This commit is contained in:
Martin Haye 2018-05-12 07:58:27 -07:00
parent 80cf33d17b
commit 4839168bbf
3 changed files with 21 additions and 14 deletions

View File

@ -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"
}
}

View File

@ -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

View File

@ -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 <http://www.apache.org/licenses/LICENSE-1.1>.
// 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