mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-04 02:31:08 +00:00
Added generation for generic items like amulets.
This commit is contained in:
parent
d89d9dfbad
commit
30a9f15ae2
@ -1943,7 +1943,12 @@ end
|
||||
|
||||
def genItem(func, row, out)
|
||||
{
|
||||
out.println " //item name=${row.@name}"
|
||||
out.println(
|
||||
" return makeItem(" +
|
||||
"${escapeString(parseStringAttr(row, "name"))}, " +
|
||||
"${parseWordAttr(row, "price")}, " +
|
||||
"${parseModifier(row, "bonus-value", "bonus-attribute")}, " +
|
||||
"${parseByteAttr(row, "numofuses")})")
|
||||
}
|
||||
|
||||
def genPlayer(func, row, out)
|
||||
@ -2122,6 +2127,16 @@ def makeStuff(name, kind, price, count)
|
||||
p=>w_maxCount = count
|
||||
return p
|
||||
end
|
||||
|
||||
def makeItem(name, price, modifier, maxUses)
|
||||
word p; p = mmgr(HEAP_ALLOC, TYPE_ARMOR)
|
||||
p=>s_name = mmgr(HEAP_INTERN, name)
|
||||
p=>w_price = price
|
||||
p=>p_modifiers = modifier
|
||||
p->b_maxUses = maxUses
|
||||
p->b_curUses = 0
|
||||
return p
|
||||
end
|
||||
""")
|
||||
|
||||
// Generate all the functions themselves
|
||||
|
@ -96,6 +96,9 @@ struc Item
|
||||
word s_itemKind
|
||||
word w_price
|
||||
word p_modifiers // list:modifier
|
||||
// Usables properties
|
||||
byte b_maxUses
|
||||
byte b_curUses
|
||||
end
|
||||
|
||||
const WEAPON_FLAG_SINGLE_USE = $01
|
||||
|
Loading…
Reference in New Issue
Block a user