Works for me:
Code: Select all
print("bomb")
local bomb = self.go.bombitem
print("before: " .. bomb:getBombPower())
bomb:setBombPower(1)
print("after: " .. bomb:getBombPower())
Code: Select all
bomb
before: 55
after: 1
Code: Select all
function fire()
fire_bomb_2.bombitem:setBombPower(1)
end
It seems like the game treats bombs and other thrown weapons differentlyminmay wrote: ↑Tue Apr 16, 2019 10:55 pm Are you sure you are using the same bomb that you set the bomb power of? Remember, splitting a stack, including by using a ThrowAttackComponent/RangedAttackComponent, makes a new item with almost none of the attributes of the original stack. If you set the bombPower of a stack of 2 bombs to 1, but then split the stack by using the ThrowAttackComponent, the thrown bomb will have the original 55 power.
Code: Select all
if self.go.bombitem then
print("bomb")
local bomb = self.go.bombitem
print("before: " .. bomb:getBombPower())
bomb:setBombPower(999)
print("after: " .. bomb:getBombPower())
else
print("knife")
print("before: " .. self:getAttackPower())
self:setAttackPower(999)
print("after: " .. self:getAttackPower())
end
I couldn't have dreamed of a better explaination, thanks !
Ok, found something : I call the destroy() method on the chest and recreate it after the party has been teleported. It doesn't answer the question "how do we close a chest" nor "how do we physically move the party" and it is not elegant but my problem is solved : no more flickering.
Code: Select all
party.party:knockback(party.facing+2%3)