Compare commits
3 Commits
9515dad661
...
0736314600
Author | SHA1 | Date | |
---|---|---|---|
0736314600 | |||
87fb216256 | |||
daa6cb4cb4 |
@ -497,10 +497,12 @@ void TELY_DLL_Init(void *user_data)
|
||||
game->merchant_phone_company = FP_Entity_CreateMerchantPhoneCompany(game, base_top_right, "PhoneCompany");
|
||||
}
|
||||
|
||||
#if 0
|
||||
FP_Entity_CreateClubTerry(game, Dqn_V2_InitNx2(+500, -191), "Club Terry");
|
||||
FP_Entity_CreateKennelTerry(game, Dqn_V2_InitNx2(-300, -191), "Kennel Terry");
|
||||
FP_Entity_CreateChurchTerry(game, Dqn_V2_InitNx2(-800, -191), "Church Terry");
|
||||
FP_Entity_CreateAirportTerry(game, Dqn_V2_InitNx2(-1200, -191), "Airport Terry");
|
||||
#endif
|
||||
|
||||
game->tile_size = 37;
|
||||
Dqn_V2I max_tile = platform->core.window_size / game->tile_size;
|
||||
@ -1920,14 +1922,14 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
|
||||
|
||||
// NOTE: Recover mobile data
|
||||
entity->terry_mobile_data_plan =
|
||||
DQN_MIN(entity->terry_mobile_data_plan + DQN_CAST(Dqn_usize)(FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK * .25f * PHYSICS_STEP),
|
||||
DQN_MIN(entity->terry_mobile_data_plan + DQN_CAST(Dqn_usize)(FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK * .125f * PHYSICS_STEP),
|
||||
entity->terry_mobile_data_plan_cap);
|
||||
|
||||
// NOTE: Recover hp & stamina
|
||||
entity->stamina = DQN_MIN(entity->stamina + 1, entity->stamina_cap);
|
||||
entity->stamina = DQN_MIN(entity->stamina + 0.25f, entity->stamina_cap);
|
||||
|
||||
if (game->update_counter % 12 == 0) {
|
||||
entity->hp = DQN_MIN(entity->hp + 1, entity->hp_cap);
|
||||
entity->hp = DQN_MIN(entity->hp + 0.75f, entity->hp_cap);
|
||||
}
|
||||
|
||||
// NOTE: Derive dynmamic bounding boxes ====================================================
|
||||
@ -2041,12 +2043,13 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
|
||||
// NOTE: Do HP =========================================================================
|
||||
defender->hp = defender->hp >= FP_DEFAULT_DAMAGE ? defender->hp - FP_DEFAULT_DAMAGE : 0;
|
||||
if (defender->hp <= 0) {
|
||||
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;
|
||||
if (!defender->is_dying)
|
||||
coin_receiver->coins += 1;
|
||||
defender->is_dying = true;
|
||||
}
|
||||
|
||||
// NOTE: Kickback ======================================================================
|
||||
|
@ -137,6 +137,6 @@ struct FP_EntityRenderData
|
||||
TELY_AssetAnimatedSprite sprite;
|
||||
};
|
||||
|
||||
Dqn_usize const FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK = DQN_KILOBYTES(1);
|
||||
Dqn_usize const FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK = DQN_KILOBYTES(5);
|
||||
uint16_t const FP_TERRY_DASH_STAMINA_COST = 33;
|
||||
uint16_t const FP_DEFAULT_DAMAGE = 30;
|
||||
|
@ -459,7 +459,7 @@ static FP_GameEntityHandle FP_Entity_CreateTerry(FP_Game *game, Dqn_V2 pos, DQN_
|
||||
entity->local_hit_box_size = FP_Game_MetersToPixelsNx2(game, 0.5f, entity->sprite_height.meters * .6f);
|
||||
entity->hp_cap = FP_DEFAULT_DAMAGE * 3;
|
||||
entity->hp = entity->hp_cap;
|
||||
entity->coins = 1'000'000;
|
||||
entity->coins = 0;//1'000'000;
|
||||
FP_Entity_AddDebugEditorFlags(game, result);
|
||||
entity->flags |= FP_GameEntityFlag_NonTraversable;
|
||||
entity->flags |= FP_GameEntityFlag_Attackable;
|
||||
|
@ -229,15 +229,15 @@ static FP_GameEntity *FP_Game_MakeEntityPointerFV(FP_Game *game, DQN_FMT_STRING_
|
||||
result->hp_cap = FP_DEFAULT_DAMAGE;
|
||||
result->hp = result->hp_cap;
|
||||
|
||||
result->inventory.airports_base_price = 4;
|
||||
result->inventory.churchs_base_price = 2;
|
||||
result->inventory.kennels_base_price = 2;
|
||||
result->inventory.clubs_base_price = 2;
|
||||
result->inventory.airports_base_price = 100;
|
||||
result->inventory.churchs_base_price = 50;
|
||||
result->inventory.kennels_base_price = 50;
|
||||
result->inventory.clubs_base_price = 50;
|
||||
|
||||
result->inventory.stamina_base_price = 2;
|
||||
result->inventory.health_base_price = 2;
|
||||
result->inventory.mobile_plan_base_price = 2;
|
||||
result->inventory.attack_base_price = 2;
|
||||
result->inventory.stamina_base_price = 10;
|
||||
result->inventory.health_base_price = 10;
|
||||
result->inventory.mobile_plan_base_price = 10;
|
||||
result->inventory.attack_base_price = 10;
|
||||
|
||||
|
||||
// NOTE: Attach entity as a child to the parent
|
||||
|
@ -223,9 +223,9 @@ struct FP_GameEntity
|
||||
|
||||
Dqn_usize coins;
|
||||
FP_GameInventory inventory;
|
||||
uint16_t hp;
|
||||
Dqn_f32 hp;
|
||||
uint16_t hp_cap;
|
||||
uint16_t stamina;
|
||||
Dqn_f32 stamina;
|
||||
uint16_t stamina_cap;
|
||||
|
||||
bool converted_faction;
|
||||
|
Loading…
Reference in New Issue
Block a user