Added ammo generation.

This commit is contained in:
Martin Haye 2016-06-17 07:26:53 -07:00
parent fd989c0d32
commit d5f1663267
3 changed files with 20 additions and 4 deletions

View File

@ -1896,7 +1896,12 @@ class PackPartitions
def genAmmo(func, row, out)
{
out.println " //ammo name=${row.@name}"
out.println(
" return makeStuff(" +
"${escapeString(parseStringAttr(row, "name"))}, " +
"${escapeString(parseStringAttr(row, "type"))}, " +
"${parseWordAttr(row, "price")}, " +
"${parseWordAttr(row, "max")})")
}
def genItem(func, row, out)

View File

@ -118,7 +118,7 @@ const randomFromArray = gameLibVecs + 3*57
const makePlayer_pt1 = gameLibVecs + 3*58
const makePlayer_pt2 = gameLibVecs + 3*59
const calcPlayerArmor = gameLibVecs + 3*60
const UNUSED_FN_61 = gameLibVecs + 3*61
const makeAmmo = gameLibVecs + 3*61
const UNUSED_FN_62 = gameLibVecs + 3*62
const UNUSED_FN_63 = gameLibVecs + 3*63
const UNUSED_FN_64 = gameLibVecs + 3*64

View File

@ -111,7 +111,7 @@ predef _reboot, _brk, _encodeDice, _rollDice
predef _setPlural, _makeEnemy, _getStringResponse, _strcmpi, _addEncounterZone, _fatal
predef _pause, _tossStrings, _showMapName, _setMapWindow
predef _makeModifier, _makeArmor, _makeWeapon_pt1, _makeWeapon_pt2, _randomFromArray
predef _makePlayer_pt1, _makePlayer_pt2, _calcPlayerArmor
predef _makePlayer_pt1, _makePlayer_pt2, _calcPlayerArmor, _makeAmmo
word gameLib_addrs = @_setScriptInfo, @_scriptDisplayStr, @_scriptDisplayStrNL, @_getYN
word = @_queue_setMap, @_setSky, @_setGround, @_queue_teleport, @_setPortrait, @_clearPortrait
@ -127,7 +127,7 @@ word = @_reboot, @_brk, @_encodeDice, @_rollDice
word = @_setPlural, @_makeEnemy, @_getStringResponse, @_strcmpi, @_addEncounterZone, @_fatal
word = @_pause, @_tossStrings, @_showMapName, @_setMapWindow
word = @_makeModifier, @_makeArmor, @_makeWeapon_pt1, @_makeWeapon_pt2, @_randomFromArray
word = @_makePlayer_pt1, @_makePlayer_pt2, @_calcPlayerArmor
word = @_makePlayer_pt1, @_makePlayer_pt2, @_calcPlayerArmor, @_makeAmmo
word = 0 // end of library functions
@ -2230,6 +2230,17 @@ def _calcPlayerArmor(player)
loop
end
///////////////////////////////////////////////////////////////////////////////////////////////////
def _makeAmmo(name, kind, price, count)
word p; p = mmgr(HEAP_ALLOC, TYPE_ARMOR)
p=>s_name = mmgr(HEAP_INTERN, name)
p=>s_itemKind = mmgr(HEAP_INTERN, kind)
p=>w_price = price
p=>w_count = count
p=>w_maxCount = count
return p
end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Create the party
def initParty()