Fixed charge
- Prevent click sound from triggering - Prevent hovering on pits if you end charge on them - Trigger traps if you end charge on them
This commit is contained in:
parent
ee8274038f
commit
e1c154fc1c
|
@ -5,10 +5,10 @@ SET(CMAKE_COLOR_MAKEFILE ON)
|
|||
project(breakhack C)
|
||||
|
||||
set(breakhack_GAME_TITLE "BreakHack")
|
||||
set(breakhack_MAJOR_VERSION 0)
|
||||
set(breakhack_MINOR_VERSION 3)
|
||||
set(breakhack_PATCH_VERSION 0)
|
||||
set(breakhack_RELEASE_TYPE "(beta)")
|
||||
set(breakhack_MAJOR_VERSION 1)
|
||||
set(breakhack_MINOR_VERSION 0)
|
||||
set(breakhack_PATCH_VERSION 1)
|
||||
set(breakhack_RELEASE_TYPE "")
|
||||
|
||||
include(FindLua)
|
||||
include(FindPhysFS)
|
||||
|
|
10
src/player.c
10
src/player.c
|
@ -208,8 +208,7 @@ has_collided(Player *player, RoomMatrix *matrix, Vector2d direction)
|
|||
}
|
||||
|
||||
if (space->lethal && !collided) {
|
||||
mixer_play_effect(FALL0 + get_random(2) - 1);
|
||||
player->state = FALLING;
|
||||
player_set_falling(player);
|
||||
}
|
||||
|
||||
if (space->trap && !collided) {
|
||||
|
@ -697,3 +696,10 @@ player_add_artifact(Player *p, Artifact *a)
|
|||
gui_log("%s (%u)", ad->desc, ad->level);
|
||||
p->equipment.hasArtifacts = true;
|
||||
}
|
||||
|
||||
void
|
||||
player_set_falling(Player *player)
|
||||
{
|
||||
mixer_play_effect(FALL0 + get_random(2) - 1);
|
||||
player->state = FALLING;
|
||||
}
|
||||
|
|
|
@ -123,3 +123,6 @@ player_has_artifact(Player *, MagicalEffect);
|
|||
|
||||
void
|
||||
player_add_artifact(Player*, Artifact*);
|
||||
|
||||
void
|
||||
player_set_falling(Player*);
|
||||
|
|
|
@ -393,7 +393,7 @@ skill_charge_check_path(SkillData *data,
|
|||
Monster *monster = matrix->spaces[itPos.x][itPos.y].monster;
|
||||
Stats tmpStats = player->stats;
|
||||
tmpStats.dmg *= steps > 0 ? steps : 1;
|
||||
mixer_play_effect(SWING0 + get_random(3) - 1);
|
||||
mixer_play_effect(SWING0 + get_random(2));
|
||||
unsigned int dmg = stats_fight(&tmpStats, &monster->stats);
|
||||
if (dmg > 0) {
|
||||
gui_log("You charged %s for %u damage", monster->lclabel, dmg);
|
||||
|
@ -492,6 +492,13 @@ skill_charge(Skill *skill, SkillData *data)
|
|||
|
||||
skill_charge_check_path(data, playerStartPos, destination);
|
||||
|
||||
Position lastTilePos = position_to_matrix_coords(&playerDestinationPos);
|
||||
RoomSpace *destSpace = &matrix->spaces[lastTilePos.x][lastTilePos.y];
|
||||
if (destSpace->lethal)
|
||||
player_set_falling(player);
|
||||
else if (destSpace->trap)
|
||||
trap_activate(destSpace->trap, player);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue