Code: Select all
defineObject{
name = "dm_staff_of_manar1",
baseObject = "base_dm_item",
components = {
{
class = "Model",
model = "mod_assets/dmcsb_pack/models/items/dm_staff_of_manar.fbx",
},
{
class = "Item",
uiName = "Staff of Lightning bolt +1",
description = "An ancient magical staff that shoots lightning bolts",
gfxAtlas = "mod_assets/dmcsb_pack/textures/gui/dm_icoatlas.tga",
gfxIndex = 71,
gfxIndexPowerAttack = 150,
impactSound = "impact_blunt",
weight = 2.9,
primaryAction = "lightningBolt",
},
{
class = "CastSpell",
name = "lightningBolt",
uiName = "Lightning Bolt",
spell = "lightning_bolt",
charges = 5,
power = 1, -- results in 36 attack power instead of the 30 in grimrock 1, but that's okay IMO
},
},
tags = { "weapon" },
}
This staff has 5 charges and every time you click it, it will shoot a lightning bolt instantly. there is also no cooldown, so you can unleash all 5 charges in less than a second during difficult encounters.
I had several ideas, a recharge station in the town. I made one, it's clunky, but it works and it can recharge any wand or magic object with charges. I would like to simplify it as it involves dropping the empty wand on the power station, destroys it and simply gives a new wand which means a lot of code to manually add every single object. If anyone has any ideas let me know
A recharging crystal item that is not a one time consumable would work as well. You can't leave the room as long the recharging crystal is not on it's pedestal. This way the object can not leave the room.
2nd idea: a timer component? that recharges the wand with 1 charge every 2 minutes. This one is currently my preference.
the question is how?
3rd idea: simply a secondary action that recharges the wand for 150 energy. in case the 2nd idea proves to be impossible to code.
Basically like recharging the revolver. But I would like help with the code needed. Looking at defineobject code of the recharging crystal consumable + the revolver doesn't cut it.