本文整理汇总了C#中Floor.add_new_popup方法的典型用法代码示例。如果您正苦于以下问题:C# Floor.add_new_popup方法的具体用法?C# Floor.add_new_popup怎么用?C# Floor.add_new_popup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor.add_new_popup方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update_Monster
public override void Update_Monster(Player pl, Floor fl)
{
heal_near_altar(fl);
detect_player(pl, fl);
has_moved = false;
if (!stunned)
{
if (can_see_player)
{
last_seen_player_loc = pl.get_my_grid_C();
if (sequence_cooldown == 0)
{
if (!bite_available && !volley_available)
{
bite_available = true;
volley_available = true;
bite_stage = 0;
volley_stage = 0;
}
if (bite_available && volley_available)
{
if (rGen.Next(2) == 0)
{
current_sequence = attack_sequence.Biting;
bite_available = false;
}
else
{
current_sequence = attack_sequence.Volley;
volley_available = false;
}
sequence_cooldown = 4;
}
else
{
if (!bite_available)
{
current_sequence = attack_sequence.Volley;
volley_available = false;
}
else
{
current_sequence = attack_sequence.Biting;
bite_available = false;
}
sequence_cooldown = 4;
}
}
switch (current_sequence)
{
case attack_sequence.None:
if(is_player_within(pl, 1))
{
fl.addmsg("The Boneyard slashes at you!");
Attack dmg = dealDamage();
fl.add_effect(dmg_type, pl.get_my_grid_C());
pl.take_damage(dmg, fl, "");
sequence_cooldown--;
}
else
{
advance_towards_single_point(pl.get_my_grid_C(), pl, fl, 1, corporeal);
if (!has_moved)
fire_singletarget_bonespear(fl, pl.get_my_grid_C());
else
sequence_cooldown--;
}
break;
case attack_sequence.Biting:
switch (bite_stage)
{
case 0:
my_Texture = bitey_texture;
fl.add_new_popup("Roars!", Popup.popup_msg_type.Alert, my_center_coordinate(), false, false);
bloodspray(fl, pl);
bite_stage++;
break;
case 1:
bite_alert(fl);
bite_stage++;
break;
case 2:
//Bite goes off
execute_bite(fl, pl);
bite_stage = 0;
my_Texture = normal_texture;
current_sequence = attack_sequence.None;
break;
}
break;
case attack_sequence.Volley:
switch (volley_stage)
{
case 0:
//target player
//.........这里部分代码省略.........
示例2: take_aoe_damage
public void take_aoe_damage(int min_dmg, int max_dmg,
Attack.Damage dmg_type, Floor fl)
{
List<Limb> target_limbs = new List<Limb>();
List<Armor.Attack_Zone> target_zones = new List<Armor.Attack_Zone>();
//Head and chest
int hc_dodge_roll = rGen.Next(100);
if (hc_dodge_roll < dodge_chance)
{
fl.add_new_popup("Dodged!", Popup.popup_msg_type.Dodge, my_grid_coord, false, false);
message_buffer.Add("You dodge the attack!");
}
else
{
int h_wnd = rGen.Next(min_dmg, max_dmg+1);
Attack head_attack = new Attack(dmg_type, h_wnd);
if (helm != null)
head_attack = helm.absorb_damage(head_attack, my_grid_coord,
ref rGen, ref message_buffer, ref fl);
Head.add_injury(dmg_type, h_wnd);
target_limbs.Add(Torso);
target_zones.Add(Armor.Attack_Zone.Chest);
}
//R Arm / Leg
int rs_dodge_roll = rGen.Next(100);
if (rs_dodge_roll < dodge_chance)
{
fl.add_new_popup("Dodged!", Popup.popup_msg_type.Dodge, my_grid_coord, false, false);
message_buffer.Add("You dodge the attack!");
}
else
{
target_limbs.Add(R_Arm);
target_zones.Add(Armor.Attack_Zone.R_Arm);
target_limbs.Add(R_Leg);
target_zones.Add(Armor.Attack_Zone.R_Leg);
}
//L Arm / Leg
int ls_dodge_roll = rGen.Next(100);
if (ls_dodge_roll < dodge_chance)
{
fl.add_new_popup("Dodged!", Popup.popup_msg_type.Dodge, my_grid_coord, false, false);
message_buffer.Add("You dodge the attack!");
}
else
{
target_limbs.Add(L_Arm);
target_zones.Add(Armor.Attack_Zone.L_Arm);
target_limbs.Add(L_Leg);
target_zones.Add(Armor.Attack_Zone.L_Leg);
}
for (int i = 0; i < target_limbs.Count; i++)
{
Attack next_attack = new Attack(dmg_type, rGen.Next(min_dmg, max_dmg+1));
int atk_dmg = next_attack.get_damage_amt();
if (over_armor != null)
next_attack = over_armor.absorb_damage(next_attack, my_grid_coord, ref rGen, ref message_buffer, ref fl);
if (under_armor != null)
next_attack = under_armor.absorb_damage(next_attack, my_grid_coord, ref rGen, ref message_buffer, ref fl);
target_limbs[i].add_injury(next_attack.get_dmg_type(), next_attack.get_damage_amt());
if (next_attack.get_damage_amt() > 0)
fl.add_new_popup("-" + next_attack.get_damage_amt() + " " + target_limbs[i].get_shortname(), Popup.popup_msg_type.Damage, my_grid_coord, next_attack.get_damage_amt() < atk_dmg, false, dmg_type);
message_buffer.Add("Your " + target_limbs[i].get_longname() + " takes " + next_attack.get_damage_amt() + " wounds!");
}
handle_postdamage_calculations();
if (my_class == Chara_Class.Warrior)
c_energy += 12 + rGen.Next(18);
}
示例3: take_damage
public void take_damage(Attack atk, Floor fl, string specific_part)
{
//OKAY THIS IS GONNA BE COMPLICATED.
//First, figure out where the attack is gonna hit. The breakdown is as follows:
//head, 5%, chest = 25%, arm = 17%, leg = 18%
int hit_location = rGen.Next(100);
int overall_damage = atk.get_damage_amt();
int armor_absorbed = 0;
switch (specific_part)
{
case "Head":
hit_location = 0;
break;
case "Chest":
hit_location = 76;
break;
case "LArm":
hit_location = 23;
break;
case "RArm":
hit_location = 6;
break;
case "LLeg":
hit_location = 58;
break;
case "RLeg":
hit_location = 40;
break;
}
int dodge_roll = rGen.Next(100);
bool dodged = false;
if (dodge_roll < dodge_chance)
{
dodged = true;
fl.add_new_popup("Dodged!", Popup.popup_msg_type.Dodge, my_grid_coord, false, false);
message_buffer.Add("You dodge the attack!");
}
if (!dodged)
{
bool head_shot = false;
Limb target_limb = null;
if (hit_location < 5 && !Head.is_disabled())
{
head_shot = true;
target_limb = Head;
}
else if (hit_location >= 5 && hit_location < 22 && !R_Arm.is_disabled())
target_limb = R_Arm;
else if (hit_location >= 22 && hit_location < 39 && !L_Arm.is_disabled())
target_limb = L_Arm;
else if (hit_location >= 39 && hit_location < 57 && !R_Leg.is_disabled())
target_limb = R_Leg;
else if (hit_location >= 57 && hit_location < 75 && !L_Leg.is_disabled())
target_limb = L_Leg;
else
target_limb = Torso;
if (!head_shot)
{
if (over_armor != null)
atk = over_armor.absorb_damage(atk, my_grid_coord, ref rGen, ref message_buffer, ref fl);
if (under_armor != null)
atk = under_armor.absorb_damage(atk, my_grid_coord, ref rGen, ref message_buffer, ref fl);
}
else
{
if (helm != null)
atk = helm.absorb_damage(atk, my_grid_coord, ref rGen, ref message_buffer, ref fl);
}
for (int i = 0; i < BuffDebuffTracker.Count; i++)
{
if (BuffDebuffTracker[i].get_my_type() == Scroll.Status_Type.LesserMageArmor ||
BuffDebuffTracker[i].get_my_type() == Scroll.Status_Type.LesserSOF)
handle_armor_buffs(BuffDebuffTracker[i].get_my_type(), ref atk);
}
armor_absorbed = overall_damage - atk.get_damage_amt();
int dmg = atk.get_damage_amt();
target_limb.add_injury(atk.get_dmg_type(), dmg);
if (dmg > 0)
fl.add_new_popup("-" + dmg + " " + target_limb.get_shortname(), Popup.popup_msg_type.Damage, my_grid_coord, armor_absorbed > 0, false, atk.get_dmg_type());
message_buffer.Add("Your " + target_limb.get_longname() + " takes " + dmg + " wounds!");
}
handle_postdamage_calculations();
if (my_class == Chara_Class.Warrior)
{
c_energy += 2 + rGen.Next(3);
if (atk.is_armor_breaking_attack())
c_energy++;
}
if (!is_alive())
//.........这里部分代码省略.........
示例4: loot
//Green text. Function here.
public void loot(Floor fl)
{
for (int i = 0; i < fl.show_me_the_money().Count; i++)
{
gridCoordinate moneyPos = fl.show_me_the_money()[i].get_my_grid_C();
if (my_grid_coord.x == moneyPos.x && my_grid_coord.y == moneyPos.y)
{
int gold_val = fl.show_me_the_money()[i].my_quantity;
add_gold(gold_val);
message_buffer.Add("You loot " + gold_val + " gold!");
fl.add_new_popup("+ " + gold_val + " gold!", Popup.popup_msg_type.Alert, my_grid_coord, false, false);
fl.show_me_the_money().RemoveAt(i);
break;
}
}
}
示例5: ingest_potion
public void ingest_potion(Potion pt, Floor fl, bool repair_over_armor)
{
double base_potency = (double)pt.potion_potency() * 1.6;
if (my_character == Character.Ziktofel)
base_potency *= 1.6;
int potency = (int)Math.Ceiling(base_potency);
bool done = false;
Armor target_armor = null;
int head_tally = 0;
int chest_tally = 0;
int rarm_tally = 0;
int larm_tally = 0;
int lleg_tally = 0;
int rleg_tally = 0;
if (pt.get_type() == Potion.Potion_Type.Health)
{
while (!done)
{
int target_part = rGen.Next(6);
switch (target_part)
{
case 0:
if (!Head.is_uninjured())
{
Head.heal_via_potion(1);
head_tally++;
potency--;
}
break;
case 1:
if (!Torso.is_uninjured())
{
Torso.heal_via_potion(1);
chest_tally++;
potency--;
}
break;
case 2:
if (!R_Arm.is_uninjured())
{
R_Arm.heal_via_potion(1);
rarm_tally++;
potency--;
}
break;
case 3:
if (!L_Arm.is_uninjured())
{
L_Arm.heal_via_potion(1);
larm_tally++;
potency--;
}
break;
case 4:
if (!R_Leg.is_uninjured())
{
R_Leg.heal_via_potion(1);
rleg_tally++;
potency--;
}
break;
case 5:
if (!L_Leg.is_uninjured())
{
L_Leg.heal_via_potion(1);
lleg_tally++;
potency--;
}
break;
}
if (potency == 0)
done = true;
if (Head.is_uninjured() && Torso.is_uninjured() &&
L_Arm.is_uninjured() && L_Leg.is_uninjured() &&
R_Arm.is_uninjured() && R_Leg.is_uninjured())
done = true;
}
//display messages of how many wounds were healed for the player.
if (head_tally > 0)
fl.add_new_popup("+" + head_tally + " Head", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
if (chest_tally > 0)
fl.add_new_popup("+" + chest_tally + " Chest", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
if (larm_tally > 0)
fl.add_new_popup("+" + larm_tally + " LArm", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
if (rarm_tally > 0)
fl.add_new_popup("+" + rarm_tally + " RArm", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
if (lleg_tally > 0)
fl.add_new_popup("+" + lleg_tally + " LLeg", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
if (rleg_tally > 0)
fl.add_new_popup("+" + rleg_tally + " RLeg", Popup.popup_msg_type.Healing, my_grid_coord, false, false);
}
calculate_dodge_chance();
update_pdoll();
//.........这里部分代码省略.........
示例6: heal_via_potion
public void heal_via_potion(Potion pt, string bodypart, bool repair_over_armor, Floor fl)
{
double potion_potency = (double)pt.potion_potency();
if (my_character == Character.Ziktofel)
potion_potency = Math.Ceiling((double)pt.potion_potency() * 1.6);
int heal_value = (int)potion_potency;
if (pt.get_type() == Potion.Potion_Type.Health)
{
Limb target_limb = null;
switch (bodypart)
{
case "Head":
target_limb = Head;
break;
case "Chest":
target_limb = Torso;
break;
case "LArm":
target_limb = L_Arm;
break;
case "RArm":
target_limb = R_Arm;
break;
case "LLeg":
target_limb = L_Leg;
break;
case "RLeg":
target_limb = R_Leg;
break;
}
target_limb.heal_via_potion(heal_value);
fl.add_new_popup("+" + heal_value + " " + target_limb.get_shortname(), Popup.popup_msg_type.Healing, my_grid_coord, false, false);
}
calculate_dodge_chance();
update_pdoll();
pt.drink();
}
示例7: heal_random_part
public void heal_random_part(int potency, Floor fl)
{
List<Limb> parts = new List<Limb> { Head, Torso, R_Arm, R_Leg, L_Arm, L_Leg };
Limb target_limb = parts[rGen.Next(parts.Count)];
target_limb.heal_via_potion(potency);
fl.add_new_popup("+" + potency + " " + target_limb.get_shortname(), Popup.popup_msg_type.Healing, my_grid_coord, false, false);
calculate_dodge_chance();
update_pdoll();
}
示例8: damage_random_part
//this is used for hemorrhage.
public void damage_random_part(int dmg, Attack.Damage dmgTyp, Floor fl)
{
int chosen_part = rGen.Next(6);
Limb target_part = null;
switch (chosen_part)
{
case 0:
target_part = Head;
break;
case 1:
target_part = L_Arm;
break;
case 2:
target_part = R_Arm;
break;
case 3:
target_part = L_Leg;
break;
case 4:
target_part = R_Leg;
break;
case 5:
target_part = Torso;
break;
}
if (target_part.is_disabled())
target_part = Torso;
target_part.add_injury(dmgTyp, dmg);
fl.add_new_popup("-" + dmg.ToString() + " " + target_part.get_shortname(), Popup.popup_msg_type.Damage, my_grid_coord, false, false, dmgTyp);
message_buffer.Add("Your " + target_part.get_longname() + " takes " + dmg.ToString() + " wounds.");
handle_postdamage_calculations();
if (my_class == Chara_Class.Warrior)
c_energy += 2 + rGen.Next(3);
}