本文整理汇总了C#中Projectile.set_AOE_size方法的典型用法代码示例。如果您正苦于以下问题:C# Projectile.set_AOE_size方法的具体用法?C# Projectile.set_AOE_size怎么用?C# Projectile.set_AOE_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projectile
的用法示例。
在下文中一共展示了Projectile.set_AOE_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bloodspray
//.........这里部分代码省略.........
pl_y_dir = -1;
List<gridCoordinate> potential_spray_targets = new List<gridCoordinate>();
List<gridCoordinate> blood_spray_targets = new List<gridCoordinate>();
if (pl_x_dir == 0)
{
int y_coord = top_left.y;
if (pl_y_dir > 0)
y_coord = bottom_right.y;
for (int x = top_left.x - 1; x <= bottom_right.x + 1; x++)
for (int y = y_coord + (pl_y_dir * 2); y != y_coord + (pl_y_dir * 4); y += pl_y_dir)
potential_spray_targets.Add(new gridCoordinate(x, y));
}
else if (pl_y_dir == 0)
{
int x_coord = top_left.x;
if (pl_x_dir > 0)
x_coord = bottom_right.x;
for (int x = x_coord + (pl_x_dir * 2); x != x_coord + (pl_x_dir * 4); x += pl_x_dir)
for (int y = top_left.y - 1; y <= bottom_right.y + 1; y++)
potential_spray_targets.Add(new gridCoordinate(x, y));
}
else
{
for(int i = 0; i < my_grid_coords.Count; i++)
potential_spray_targets.Add(new gridCoordinate(my_grid_coords[i].x + (pl_x_dir*3),
my_grid_coords[i].y + (pl_y_dir*3)));
int upper_x = 0;
int lower_x = 0;
if (pl_x_dir == 1)
{
upper_x = 0;
lower_x = 2;
}
else if (pl_x_dir == -1)
{
upper_x = 1;
lower_x = 3;
}
int left_y = 0;
int right_y = 0;
if (pl_y_dir == 1)
{
left_y = 0;
right_y = 1;
}
else if (pl_y_dir == -1)
{
left_y = 2;
right_y = 3;
}
//The above code gives us a 2x2 zone. For this, we want to extend the zone by one
//x tile and y tile in the opposite direction of where the player is relative to the boneyard
//That's why the above code picks out the 2 coordinates from the x axis and y axis, because
potential_spray_targets.Add(new gridCoordinate(potential_spray_targets[upper_x].x + (pl_x_dir*-1),
potential_spray_targets[upper_x].y));
potential_spray_targets.Add(new gridCoordinate(potential_spray_targets[lower_x].x + (pl_x_dir*-1),
potential_spray_targets[lower_x].y));
potential_spray_targets.Add(new gridCoordinate(potential_spray_targets[left_y].x,
potential_spray_targets[left_y].y + (pl_y_dir*-1)));
potential_spray_targets.Add(new gridCoordinate(potential_spray_targets[right_y].x,
potential_spray_targets[right_y].y + (pl_y_dir*-1)));
}
int potential_targets = 3;
//for (int i = 0; i < potential_spray_targets.Count; i++)
//fl.set_tile_aura(potential_spray_targets[i], Tile.Aura.SmellTarget);
for (int i = 0; i < potential_targets; i++)
{
bool found_valid_target = false;
while (!found_valid_target && potential_spray_targets.Count > 0)
{
int chosen_coord = rGen.Next(potential_spray_targets.Count);
if (can_i_see_point(fl, potential_spray_targets[chosen_coord]))
{
blood_spray_targets.Add(potential_spray_targets[chosen_coord]);
found_valid_target = true;
}
potential_spray_targets.RemoveAt(chosen_coord);
}
}
for (int i = 0; i < blood_spray_targets.Count; i++)
{
Projectile bspray = new Projectile(randomly_chosen_personal_coord(), blood_spray_targets[i],
Projectile.projectile_type.Bloody_AcidCloud, ref cont,
true, Scroll.Atk_Area_Type.cloudAOE, true);
bspray.set_damage_type(blood_spray_dmgtyp);
bspray.set_damage_range(blood_spray_mindmg, blood_spray_maxdmg);
bspray.set_special_anim(Projectile.special_anim.BloodAcid);
bspray.set_AOE_size(1);
fl.create_new_projectile(bspray);
}
}
示例2: cast_spell
public void cast_spell(Scroll s, Floor fl, gridCoordinate spell_target, int target_monster_ID, int target_Doodad_ID)
{
string spell_name = s.get_my_name();
Projectile.projectile_type prj_type = s.get_assoc_projectile();
Attack.Damage spell_dmg_type = s.get_damage_type();
gridCoordinate starting_coord = my_grid_coord;
Projectile.special_anim spec_prj_anim = s.get_spec_impact_anim();
c_energy -= s.get_manaCost();
max_energy += s.get_en_cap_adj();
if (max_energy > 100)
max_energy = 100;
if (max_energy < 0)
max_energy = 0;
if (s.get_spell_type() == Scroll.Atk_Area_Type.piercingBolt)
{
int spell_range = s.get_range();
int relative_x = (spell_target.x - my_grid_coord.x) * spell_range;
int relative_y = (spell_target.y - my_grid_coord.y) * spell_range;
starting_coord = new gridCoordinate(spell_target);
spell_target = new gridCoordinate(my_grid_coord.x + relative_x, my_grid_coord.y + relative_y);
}
if (s.get_spell_type() != Scroll.Atk_Area_Type.personalBuff)
{
Projectile prj = new Projectile(starting_coord, spell_target, prj_type,
ref cont, false, s.get_spell_type());
prj.attach_scroll(s);
prj.set_wall_destroying(s.spell_destroys_walls());
prj.set_special_anim(spec_prj_anim);
if (s.get_spell_type() == Scroll.Atk_Area_Type.enemyDebuff)
{
prj.attach_status_effect(s.get_status_effect(), s.get_duration(), s.does_spell_buff_count_down(), s.get_cost_per_turn(), s.get_cost_per_turn_per_turn());
}
if (s.get_spell_type() == Scroll.Atk_Area_Type.cloudAOE ||
s.get_spell_type() == Scroll.Atk_Area_Type.solidblockAOE ||
s.get_spell_type() == Scroll.Atk_Area_Type.randomblockAOE)
prj.set_AOE_size(s.get_aoe_size());
if (s.get_spell_type() == Scroll.Atk_Area_Type.chainedBolt)
{
prj.set_bounce(s.get_range());
prj.set_bounces_left(s.get_t_impacts());
}
if (String.Compare(s.get_my_name(), "Earthquake") == 0)
prj.set_special_anim(Projectile.special_anim.Earthquake);
prj.set_talisman_effects(s.get_my_equipped_talismans());
fl.create_new_projectile(prj);
}
else
{
int base_buff_time = s.get_duration();
int modified_buff_time = base_buff_time;
if (my_character == Character.Petaer)
{
double buff_time_bonus = (double)modified_buff_time * .3;
modified_buff_time = (int)Math.Ceiling((double)modified_buff_time + buff_time_bonus);
}
add_single_statusEffect(new StatusEffect(s.get_status_effect(), modified_buff_time+1, s.does_spell_buff_count_down(), s.get_cost_per_turn(), s.get_cost_per_turn_per_turn(), false));
}
}