fp: Add attack upgrade to merchant
This commit is contained in:
+9
-7
@@ -2032,14 +2032,15 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
|
||||
continue;
|
||||
}
|
||||
|
||||
defender->hp = defender->hp >= FP_DEFAULT_DAMAGE ? defender->hp - FP_DEFAULT_DAMAGE : 0;
|
||||
defender->hp = defender->hp >= attacker->base_attack ? defender->hp - attacker->base_attack : 0;
|
||||
if (defender->hp <= 0) {
|
||||
if (!defender->is_dying) {
|
||||
FP_GameEntity *coin_receiver = FP_Game_GetEntity(game, attacker->projectile_owner);
|
||||
if (FP_Game_IsNilEntity(coin_receiver))
|
||||
coin_receiver = attacker;
|
||||
coin_receiver->coins += 1;
|
||||
}
|
||||
defender->is_dying = true;
|
||||
|
||||
FP_GameEntity *coin_receiver = FP_Game_GetEntity(game, attacker->projectile_owner);
|
||||
if (FP_Game_IsNilEntity(coin_receiver))
|
||||
coin_receiver = attacker;
|
||||
coin_receiver->coins += 1;
|
||||
}
|
||||
|
||||
// NOTE: Kickback ======================================================================
|
||||
@@ -2610,8 +2611,9 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer,
|
||||
|
||||
if (mapping.merchant == game->play.merchant_terry) {
|
||||
// TODO(doyle): Attack damage? Or increase attack range?
|
||||
player->base_attack += DQN_CAST(uint32_t)(FP_DEFAULT_DAMAGE * .3f);
|
||||
} else if (mapping.merchant == game->play.merchant_graveyard) {
|
||||
player->stamina_cap += DQN_CAST(uint16_t)(FP_TERRY_DASH_STAMINA_COST * .5f);
|
||||
player->stamina_cap += DQN_CAST(uint32_t)(FP_TERRY_DASH_STAMINA_COST * .5f);
|
||||
} else if (mapping.merchant == game->play.merchant_gym) {
|
||||
player->hp_cap += FP_DEFAULT_DAMAGE;
|
||||
player->hp = player->hp_cap;
|
||||
|
||||
Reference in New Issue
Block a user