void DamageCurrentMonster(uint8_t strength, uint16_t level, uint8_t defense, uint8_t baseMultiplier, uint16_t bonusMultiplier) { uint16_t base = baseMultiplier * (2 + strength + 4*((strength * level)/8 + (strength * strength)/64 + (level * level)/64)); uint16_t damageToDeal = ApplyDefense(base, defense); damageToDeal = damageToDeal * bonusMultiplier / 100; currentMonsterHealth -= damageToDeal; ShowMainWindowRow(0, currentMonster->name, UpdateMonsterHealthText()); BattleUpdate(); }
void MonsterAttack(void) { uint16_t baseDamage; uint16_t damageToDeal; bool useMagicAttack = (currentMonster->allowMagicAttack && currentMonster->allowPhysicalAttack) ? Random(2) : currentMonster->allowMagicAttack; baseDamage = ComputePlayerHealth(currentFloor)/GetMonsterPowerDivisor(currentMonster->powerLevel); damageToDeal = ApplyDefense(baseDamage, useMagicAttack ? GetCharacter()->stats.magicDefense : GetCharacter()->stats.defense); if(DealPlayerDamage(damageToDeal)) { CloseBattleWindow(); ShowEndWindow(); } }
//Player::Player(): //Unit() //{ // //} Player::Player(Texture* texture_, float x_, float y_): Unit("Ç÷¹À̾î",texture_, x_, y_, 1, 100), focus_pos(), sub_change(0), current_weapon_num(1), current_weapon(0), main_weapon(0), melee_weapon(0), no_weapon(0),no_sub_weapon(0),pist(0), level(1), exp(0),stamina(100.0f), max_stamina(100.0f), stamina_delay(0), speed_delay(0), remain_ability(0), select_ability_num(3), ability_select_num(0), bullet(4), max_bullet(4), ability_select(false), quick_select(false), quick_menu(1), portal_time(1), state_view(false), mon_sight_view(false), berserker(false), blood_reload(0), forget_count(600), warning_time(1000), temp_invisible_turn(0), mirror_damage(0), mirror_knockback(0), sniper(false), map_hack(false/*false*/), critical(0), your_switch(3),silencer(1.0f), goangle(0.f), walkcount(0), aimed_pos(), triggercount(0), destangle(0) { for(int i =0 ;i<2;i++) sub_weapon[i] = NULL; SetSight(100.0f); no_weapon = New_Main_Weapon(MWK_NO_WEAPON, coord_def(), -1); ApplyDefense(DT_SELF_EXPLOSION, 0.5f); //Å×½ºÆ® }