本文整理汇总了C#中Weapon.get_hand_count方法的典型用法代码示例。如果您正苦于以下问题:C# Weapon.get_hand_count方法的具体用法?C# Weapon.get_hand_count怎么用?C# Weapon.get_hand_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon.get_hand_count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bash_attack
public void bash_attack(Floor fl, Monster m, gridCoordinate target_coord, Doodad d, Weapon wp)
{
bool rolled_max = false;
int xdif = 0;
int ydif = 0;
if (m != null)
{
xdif = target_coord.x - my_grid_coord.x;
ydif = target_coord.y - my_grid_coord.y;
}
else
{
xdif = d.get_g_coord().x - my_grid_coord.x;
ydif = d.get_g_coord().y - my_grid_coord.y;
}
double multiplier = 1.4;
if (wp.get_hand_count() == 2)
multiplier = 1.6;
int m_hp = 0;
if(m!= null)
m_hp = m.hitPoints;
gridCoordinate opposition_coord = new gridCoordinate(-1, -1);
if(m != null)
opposition_coord = target_coord;
else
opposition_coord = d.get_g_coord();
fl.add_effect(wp.get_my_damage_type(), opposition_coord);
if (m != null)
attack_monster_in_grid(fl, wp, m.my_Index, target_coord, multiplier, out rolled_max);
else
attack_Doodad_in_grid(fl, wp, d.get_my_index(), d.get_g_coord(), multiplier, out rolled_max);
if (m!= null && m.hitPoints > 0 && m_hp > m.hitPoints)
{
if(!m.shove(xdif, ydif, this, fl))
{
fl.add_effect(wp.get_my_damage_type(), target_coord);
attack_monster_in_grid(fl, wp, m.my_Index, target_coord, 0.5, out rolled_max);
}
}
wp.set_cooldown(standard_wpn_cooldown);
if (my_class == Chara_Class.Warrior)
{
c_energy += 5 + rGen.Next(2);
if (rolled_max)
c_energy++;
}
}
示例2: equip_off_hand
public void equip_off_hand(Weapon oh)
{
if ((oh.get_hand_count() == 1 && !R_Arm.is_disabled()) ||
(!L_Arm.is_disabled() && !R_Arm.is_disabled()))
{
unequip(Equip_Slot.Offhand);
if (oh.get_hand_count() == 2)
unequip(Equip_Slot.Mainhand);
int hnd_cnt = 0;
if (off_hand != null)
hnd_cnt = off_hand.get_hand_count();
off_hand = oh;
if (off_hand.get_hand_count() == 1 && hnd_cnt == 2)
main_hand = null;
if (off_hand.get_hand_count() == 2)
main_hand = oh;
check_for_1_5_hands(false);
remove_item_from_inventory(off_hand.get_my_IDno());
}
}
示例3: whirlwind_attack
public void whirlwind_attack(Floor fl, Weapon target_weapon)
{
bool rolled_max = false;
List<gridCoordinate> target_coordinates = new List<gridCoordinate>();
for (int x = my_grid_coord.x - 1; x <= my_grid_coord.x + 1; x++)
for (int y = my_grid_coord.y - 1; y <= my_grid_coord.y + 1; y++)
if(!(x== my_grid_coord.x && y== my_grid_coord.y))
target_coordinates.Add(new gridCoordinate(x, y));
int monster_ID = -1;
int Doodad_ID = -1;
for (int i = 0; i < target_coordinates.Count; i++)
{
double multiplier = 1.3;
if (target_weapon.get_hand_count() == 2)
multiplier = 1.6;
if (fl.is_monster_here(target_coordinates[i], out monster_ID))
attack_monster_in_grid(fl, target_weapon, monster_ID, target_coordinates[i], multiplier, out rolled_max);
if (fl.is_destroyable_Doodad_here(target_coordinates[i], out Doodad_ID))
attack_Doodad_in_grid(fl, target_weapon, Doodad_ID, target_coordinates[i], multiplier, out rolled_max);
if (fl.isWalkable(target_coordinates[i]))
fl.add_effect(target_weapon.get_my_damage_type(), target_coordinates[i]);
}
target_weapon.set_cooldown(standard_wpn_cooldown);
if (my_class == Chara_Class.Warrior)
{
c_energy += 5 + rGen.Next(2);
if (rolled_max)
c_energy++;
}
}
示例4: equip_main_hand
public void equip_main_hand(Weapon mh)
{
if ((mh.get_hand_count() == 1 && !L_Arm.is_disabled()) ||
(!L_Arm.is_disabled() && !R_Arm.is_disabled()))
{
unequip(Equip_Slot.Mainhand);
if (mh.get_hand_count() == 2)
unequip(Equip_Slot.Offhand);
//Okay, we've un-equipped both weapons.
//Now, check how many hands our current weapon has.
int hnd_cnt = 0;
if (main_hand != null)
hnd_cnt = main_hand.get_hand_count();
main_hand = mh;
if (main_hand.get_hand_count() == 1 && hnd_cnt == 2)
off_hand = null;
if (main_hand.get_hand_count() == 2)
off_hand = mh;
//Now that we've equipped, check to see if the offhand is a bow. If it is, unequip it.
check_for_1_5_hands(true);
remove_item_from_inventory(main_hand.get_my_IDno());
}
}