mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-06 16:29:40 +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)
|
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)
|
def genPlayer(func, row, out)
|
||||||
@ -2122,6 +2127,16 @@ def makeStuff(name, kind, price, count)
|
|||||||
p=>w_maxCount = count
|
p=>w_maxCount = count
|
||||||
return p
|
return p
|
||||||
end
|
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
|
// Generate all the functions themselves
|
||||||
|
@ -96,6 +96,9 @@ struc Item
|
|||||||
word s_itemKind
|
word s_itemKind
|
||||||
word w_price
|
word w_price
|
||||||
word p_modifiers // list:modifier
|
word p_modifiers // list:modifier
|
||||||
|
// Usables properties
|
||||||
|
byte b_maxUses
|
||||||
|
byte b_curUses
|
||||||
end
|
end
|
||||||
|
|
||||||
const WEAPON_FLAG_SINGLE_USE = $01
|
const WEAPON_FLAG_SINGLE_USE = $01
|
||||||
|
Loading…
Reference in New Issue
Block a user