Fight better with hands than with feet
This commit is contained in:
parent
507080a695
commit
15d9aa5dab
1 changed files with 10 additions and 6 deletions
|
@ -437,11 +437,6 @@ function collidedPlayerOrb()
|
||||||
return cavern[player_x][player_y] == tiletypes.orb or cavern[body_x][body_y] == tiletypes.orb
|
return cavern[player_x][player_y] == tiletypes.orb or cavern[body_x][body_y] == tiletypes.orb
|
||||||
end
|
end
|
||||||
|
|
||||||
function collidedPlayerSlime()
|
|
||||||
local body_x, body_y = getBodyLocation()
|
|
||||||
return cavern[player_x][player_y] == tiletypes.slime or cavern[body_x][body_y] == tiletypes.slime
|
|
||||||
end
|
|
||||||
|
|
||||||
-- ------------------------------------------------------------------
|
-- ------------------------------------------------------------------
|
||||||
-- Player helper functions
|
-- Player helper functions
|
||||||
-- ------------------------------------------------------------------
|
-- ------------------------------------------------------------------
|
||||||
|
@ -693,7 +688,16 @@ function step(direction)
|
||||||
game_mode = gamemodes.won
|
game_mode = gamemodes.won
|
||||||
end
|
end
|
||||||
|
|
||||||
if collidedPlayerSlime() then
|
local body_x, body_y = getBodyLocation()
|
||||||
|
if cavern[body_x][body_y] == tiletypes.slime then
|
||||||
|
killSlime()
|
||||||
|
hp = hp - 1
|
||||||
|
if hp == 0 then
|
||||||
|
flash_player_red_counter = 1
|
||||||
|
else
|
||||||
|
flash_player_red_counter = 0.2
|
||||||
|
end
|
||||||
|
elseif cavern[player_x][player_y] == tiletypes.slime then
|
||||||
killSlime()
|
killSlime()
|
||||||
if math.random() < 0.2 then
|
if math.random() < 0.2 then
|
||||||
flash_player_white_counter = 0.2
|
flash_player_white_counter = 0.2
|
||||||
|
|
Loading…
Reference in a new issue