本文整理汇总了C#中Floor.set_tile_aura方法的典型用法代码示例。如果您正苦于以下问题:C# Floor.set_tile_aura方法的具体用法?C# Floor.set_tile_aura怎么用?C# Floor.set_tile_aura使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor.set_tile_aura方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: set_melee_attack_aura
public void set_melee_attack_aura(Floor fl)
{
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++)
{
gridCoordinate target_coord = new gridCoordinate(x, y);
if (!(x == my_grid_coord.x && y == my_grid_coord.y) && !fl.is_tile_opaque(target_coord))
fl.set_tile_aura(target_coord, Tile.Aura.Attack);
}
}
示例2: set_ranged_attack_aura
public void set_ranged_attack_aura(Floor fl, gridCoordinate pl_gc, Scroll s, RACursor r1)
{
int bow_range = 0;
if (s == null)
{
if (main_hand != null && (main_hand.get_my_weapon_type() == Weapon.Type.Bow ||
main_hand.get_my_weapon_type() == Weapon.Type.Crossbow))
bow_range = main_hand.get_my_range();
else
bow_range = off_hand.get_my_range();
}
else
bow_range = s.get_range();
List<gridCoordinate> endpoints = new List<gridCoordinate>();
if ((is_bow_equipped() && !is_cbow_equipped()) || s != null)
{
endpoints = calculate_endpoints(pl_gc, bow_range);
}
else
{
endpoints.Add(new gridCoordinate(pl_gc.x, pl_gc.y + bow_range));
endpoints.Add(new gridCoordinate(pl_gc.x, pl_gc.y - bow_range));
endpoints.Add(new gridCoordinate(pl_gc.x + bow_range, pl_gc.y));
endpoints.Add(new gridCoordinate(pl_gc.x - bow_range, pl_gc.y));
}
List<VisionRay> range_rays = new List<VisionRay>();
for (int i = 0; i < endpoints.Count; i++)
{
range_rays.Add(new VisionRay(pl_gc, endpoints[i]));
}
endpoints.Clear();
int monsterID = -1;
while (range_rays.Count > 0)
{
for (int i = 0; i < range_rays.Count; i++)
{
bool remove = false;
int whoCares = -1;
range_rays[i].update();
gridCoordinate current_ray_position = new gridCoordinate((int)range_rays[i].my_current_position.X / 32, (int)range_rays[i].my_current_position.Y / 32);
int x_difference = positive_difference(pl_gc.x, current_ray_position.x);
int y_difference = positive_difference(pl_gc.y, current_ray_position.y);
if (!fl.is_tile_opaque(current_ray_position) && (x_difference > 1 || y_difference > 1))
fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);
if (fl.is_tile_opaque(current_ray_position) ||
fl.is_los_blocking_Doodad_here(current_ray_position))
{
remove = true;
if(s != null && s.spell_destroys_walls())
fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);
}
if ((main_hand != null && main_hand.get_my_weapon_type() == Weapon.Type.Crossbow) ||
(off_hand != null && off_hand.get_my_weapon_type() == Weapon.Type.Crossbow))
if (fl.is_monster_here(current_ray_position, out monsterID) ||
fl.is_destroyable_Doodad_here(current_ray_position, out whoCares))
remove = true;
if (range_rays[i].is_at_end() || remove)
range_rays.RemoveAt(i);
}
}
range_rays.Clear();
if (s != null && s.get_aoe_size() > 1)
{
int aoe_range = s.get_aoe_size() / 2;
endpoints = calculate_endpoints(r1.my_grid_coord, aoe_range);
bool destroys_walls = s.spell_destroys_walls();
for (int i = 0; i < endpoints.Count; i++)
{
range_rays.Add(new VisionRay(r1.my_grid_coord, endpoints[i]));
}
while (range_rays.Count > 0)
{
for (int i = 0; i < range_rays.Count; i++)
{
bool remove = false;
range_rays[i].update();
gridCoordinate current_ray_position = new gridCoordinate((int)range_rays[i].my_current_position.X / 32, (int)range_rays[i].my_current_position.Y / 32);
if (!fl.is_tile_opaque(current_ray_position))
if (fl.aura_of_specific_tile(current_ray_position) == Tile.Aura.Attack)
fl.set_tile_aura(current_ray_position, Tile.Aura.AtkAndAOE);
else if(fl.aura_of_specific_tile(current_ray_position) != Tile.Aura.AtkAndAOE &&
fl.aura_of_specific_tile(current_ray_position) != Tile.Aura.Attack)
fl.set_tile_aura(current_ray_position, Tile.Aura.AOE_Range);
if (fl.is_tile_opaque(current_ray_position) && !destroys_walls)
remove = true;
if (range_rays[i].is_at_end() || remove)
//.........这里部分代码省略.........
示例3: set_charge_attack_aura
public void set_charge_attack_aura(Floor fl, int lanceID, gridCoordinate pl_gc)
{
Weapon c_lance = null;
for (int i = 0; i < inventory.Count; i++)
{
if (inventory[i].get_my_IDno() == lanceID)
c_lance = (Weapon)inventory[i];
}
int lance_range = c_lance.get_my_range();
List<gridCoordinate> endPoints = calculate_endpoints(pl_gc, lance_range);
List<VisionRay> charge_rays = new List<VisionRay>();
for (int i = 0; i < endPoints.Count; i++)
{
charge_rays.Add(new VisionRay(pl_gc, endPoints[i]));
}
int monsterID = -1;
while (charge_rays.Count > 0)
{
for (int i = 0; i < charge_rays.Count; i++)
{
bool remove = false;
int whoCares = -1;
charge_rays[i].update();
gridCoordinate current_ray_position = new gridCoordinate((int)charge_rays[i].my_current_position.X / 32, (int)charge_rays[i].my_current_position.Y / 32);
int x_difference = positive_difference(pl_gc.x, current_ray_position.x);
int y_difference = positive_difference(pl_gc.y, current_ray_position.y);
if (fl.isWalkable(current_ray_position) && (x_difference > 1 || y_difference > 1))
fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);
if (!fl.isWalkable(current_ray_position) && (x_difference > 1 || y_difference > 1) &&
fl.is_destroyable_Doodad_here(current_ray_position, out whoCares))
fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);
if (!fl.isWalkable(current_ray_position) || fl.is_monster_here(current_ray_position, out monsterID))
remove = true;
if (charge_rays[i].is_at_end() || remove)
charge_rays.RemoveAt(i);
}
}
}