- [FIX] Retocs en habitacions

- [FIX] Quan mor, reapareix en l'habitació que toca
- [FIX] Després de morir, al agafar una clau es tornava tot roig infern (que por)
- [FIX] Si no hi havia objectes amb llum en l'habitació on mories, mai resucitaves
- [FIX] Al resucitar, totes les llums s'encenen desde cero, no nomes la teua
- [FIX] Quan t'havien pegat, no podies disparar durant el cooldown
- [FIX] Menos posibilitats de que la "safe position" estiga en un lloc mortal
This commit is contained in:
2026-03-27 20:37:06 +01:00
parent 49396331a7
commit 51f267284e
6 changed files with 56 additions and 13 deletions

View File

@@ -28,6 +28,11 @@ function ia.update_hero()
local move_anim = "hero_walk"
-- Si estem en cooldown desde l'ultim dispar, decrementem el contador
-- Si estem en cooldown desde l'ultim dispar, decrementem el contador
if sprites.hero.gun_cooldown > 0 then
sprites.hero.gun_cooldown = sprites.hero.gun_cooldown - 1
end
if sprites.hero.cooldown > 0 then
sprites.hero.cooldown = sprites.hero.cooldown - 1
end
@@ -167,7 +172,7 @@ function ia.update_hero()
sprites.hero.pos.y = (ty<<3)-1
end
anim = "hero_stand"
sprites.save_safe_pos()
if sprites.hero.state == templates.ALIVE then sprites.save_safe_pos() end
-- SI ESTÀ SOBRE UNES ESCALERES I POLSA AVALL...
if (map.tile(txm,ty+2) < 16 and map.tile(txm,ty+2) > 0) then
if key.down(key.DOWN) or pad.down(pad.DOWN) then
@@ -184,9 +189,9 @@ function ia.update_hero()
sprites.hero.jumping = 17
-- SI POLSA DISPAR...
elseif (sprites.hero.cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then
elseif (sprites.hero.gun_cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then
sprites.hero.shooting = true
sprites.hero.cooldown = 20
sprites.hero.gun_cooldown = 20
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
table.insert(sprites.list, bullet)
anim = "hero_shoot"
@@ -244,6 +249,7 @@ function ia.hero_hit(live)
if sprites.hero.lives == 0 then
sprites.hero.state = templates.DEAD
sprites.hero.invisible = nil
sprites.hero.surf = surf.load("gfx/mummy.gif")
sprites.set_animation(sprites.hero, "mummy_dying")
sprites.hero.jumping = 0
@@ -276,4 +282,6 @@ function ia.hero_reset()
sprites.hero.flipped = false
sprites.hero.light = 100
sprites.hero.pos = {x=sprites.last_safe_pos.x,y=sprites.last_safe_pos.y}
rooms.go_to_room(sprites.last_safe_room)
palfade.init()
end