本文整理汇总了C#中Floor.add_specific_effect方法的典型用法代码示例。如果您正苦于以下问题:C# Floor.add_specific_effect方法的具体用法?C# Floor.add_specific_effect怎么用?C# Floor.add_specific_effect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor.add_specific_effect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute_bite
public void execute_bite(Floor fl, Player pl)
{
int pl_x_dir = 0;
int pl_y_dir = 0;
gridCoordinate top_left = my_grid_coords[0];
gridCoordinate bottom_right = my_grid_coords[3];
int pl_x_c = pl.get_my_grid_C().x;
int pl_y_c = pl.get_my_grid_C().y;
//Determine X direction
if (pl_x_c > top_left.x && pl_x_c > bottom_right.x)
pl_x_dir = 1;
else if (pl_x_c < top_left.x && pl_x_c < bottom_right.x)
pl_x_dir = -1;
//Determine Y direction
if (pl_y_c > top_left.y && pl_y_c > bottom_right.y)
pl_y_dir = 1;
else if (pl_y_c < top_left.y && pl_y_c < bottom_right.y)
pl_y_dir = -1;
int target_index = -1;
for (int i = 0; i < movement_indexes.Count; i++)
{
if (movement_indexes[i][0] == pl_x_dir && movement_indexes[i][1] == pl_y_dir)
target_index = i;
}
List<gridCoordinate> biting_coords = new List<gridCoordinate>();
for (int i = 0; i < my_grid_coords.Count; i++)
biting_coords.Add(new gridCoordinate(my_grid_coords[i].x + (pl_x_dir*2),
my_grid_coords[i].y + (pl_y_dir*2)));
fl.add_specific_effect(Floor.specific_effect.Big_Bite, biting_coords[0]);
for(int i = 0; i < my_grid_coords.Count; i++)
if (biting_coords[i].x == pl.get_my_grid_C().x && biting_coords[i].y == pl.get_my_grid_C().y)
{
List<string> bparts = new List<string>();
if (rGen.Next(2) == 0)
{
bparts.Add("RLeg");
bparts.Add("RArm");
}
else
{
bparts.Add("LArm");
bparts.Add("LLeg");
}
fl.addmsg("The boneyard's jaws snap shut, and your bones snap with it!");
pl.take_damage(new Attack(Attack.Damage.Crushing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[0]);
pl.take_damage(new Attack(Attack.Damage.Slashing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[0]);
pl.take_damage(new Attack(Attack.Damage.Crushing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[1]);
pl.take_damage(new Attack(Attack.Damage.Slashing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[1]);
fl.addmsg("You start bleeding profusely from the attack!");
pl.add_single_statusEffect(new StatusEffect(Scroll.Status_Type.Hemorrhage, 5, true, 0, 0, false));
}
}
示例2: Update_Monster
//.........这里部分代码省略.........
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
target_bonespear(fl, pl.get_my_grid_C(), true);
fl.add_specific_effect(Floor.specific_effect.Warning_Bracket, pl.get_my_grid_C());
volley_stage++;
break;
case 1:
//shoot spear
fire_bonespear(fl, true);
//target player
target_bonespear(fl, pl.get_my_grid_C(), true);
volley_stage++;
break;
case 2:
//shoot spear
fire_bonespear(fl, true);
//target player
target_bonespear(fl, pl.get_my_grid_C(), true);
volley_stage++;
break;
case 3:
//shoot spear
fire_bonespear(fl, true);
volley_stage = 0;
current_sequence = attack_sequence.None;
break;
}
break;
}
}
else if (!can_see_player && have_i_seen_player)
{
advance_towards_single_point(last_seen_player_loc, pl, fl, 0, corporeal);
if (occupies_tile(last_seen_player_loc))
{
last_seen_player_loc = my_grid_coords[0];
have_i_seen_player = false;
}
}
else if (!can_see_player && !have_i_seen_player && heard_something)
{
//If the boneyard has LOS to the sound's origin, fire bone spears at it repeatedly - the AOE kind.
//Otherwise, simply move to the sound.
if(last_path_to_sound.Count > 0 && can_i_see_point(fl, last_path_to_sound[0]))
{
switch(blind_volley_stage)
{
case 0:
break;
case 1:
break;
}
}
else
{
follow_path_to_sound(fl, pl);
}
}
}
base.Update_Monster(pl, fl);
}
示例3: bite_alert
public void bite_alert(Floor fl)
{
for (int x = my_grid_coords[0].x - 2; x <= my_grid_coords[1].x + 2; x++)
for (int y = my_grid_coords[0].y - 2; y <= my_grid_coords[2].y + 2; y++)
{
gridCoordinate target_coord = new gridCoordinate(x, y);
if (x > 0 && x < fl.get_fl_size() &&
y > 0 && y < fl.get_fl_size() &&
fl.is_tile_passable(target_coord) &&
!occupies_tile(target_coord))
fl.add_specific_effect(Floor.specific_effect.Alert, new gridCoordinate(x, y));
}
}