本文整理汇总了C#中Floor.see_badGuys方法的典型用法代码示例。如果您正苦于以下问题:C# Floor.see_badGuys方法的具体用法?C# Floor.see_badGuys怎么用?C# Floor.see_badGuys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor.see_badGuys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: deincrement_cooldowns_and_seffects
public void deincrement_cooldowns_and_seffects(Floor fl)
{
//Make all cooldowns go down by 1
if (main_hand != null && main_hand.get_current_cooldown() > 0)
main_hand.set_cooldown(-1);
if ((off_hand != null && main_hand != null &&
main_hand.get_hand_count() == 1 &&
off_hand.get_current_cooldown() > 0) || (off_hand != null && main_hand == null))
off_hand.set_cooldown(-1);
for(int i = 0; i < inventory.Count; i++)
if (inventory[i] is Weapon)
{
Weapon w = (Weapon)inventory[i];
if (w.get_current_cooldown() > 0)
w.set_cooldown(-1);
}
int buff_cost = 0;
//Now that that's done, we handle the status effect side of things.
for (int i = 0; i < BuffDebuffTracker.Count; i++)
{
switch (BuffDebuffTracker[i].get_my_type())
{
case Scroll.Status_Type.Hemorrhage:
damage_random_part(5, Attack.Damage.Slashing, fl);
break;
}
buff_cost += BuffDebuffTracker[i].get_cost_per_turn();
buff_cost += BuffDebuffTracker[i].get_cost_per_turn_per_turn() * BuffDebuffTracker[i].get_my_duration();
if (BuffDebuffTracker[i].effect_counts_down())
BuffDebuffTracker[i].increment_duration(-1);
else
BuffDebuffTracker[i].increment_duration(1);
}
c_energy -= buff_cost;
int original_size = BuffDebuffTracker.Count;
for (int i = 0; i < original_size; i++)
for (int j = 0; j < BuffDebuffTracker.Count; j++)
if (BuffDebuffTracker[j].get_my_duration() == 0 || (c_energy < 0 && BuffDebuffTracker[j].get_cost_per_turn() > 0))
BuffDebuffTracker.RemoveAt(j);
//Add energy
if (my_class != Chara_Class.Warrior)
c_energy += 10;
else
{
List<Monster> all_monsters = fl.see_badGuys();
bool in_combat = false;
for (int i = 0; i < all_monsters.Count; i++)
{
List<gridCoordinate> monster_gcs = all_monsters[i].get_my_grid_coords();
for (int j = 0; j < monster_gcs.Count; j++)
{
if (monster_gcs[j].x >= my_grid_coord.x - 3 &&
monster_gcs[j].x <= my_grid_coord.x + 3 &&
monster_gcs[j].y >= my_grid_coord.y - 3 &&
monster_gcs[j].y <= my_grid_coord.y + 3)
in_combat = true;
if (check_for_status_effect(Scroll.Status_Type.Fury) != -1)
in_combat = true;
}
if (in_combat)
break;
}
if (!in_combat && c_energy > 0)
c_energy--;
}
if (my_class == Chara_Class.Rogue && max_energy < 50)
max_energy = 50;
if (c_energy >= max_energy)
c_energy = max_energy;
if (c_energy < 0)
c_energy = 0;
}