public bool NextStepIsDangerous(Tile next) { //todo: add vents and geysers to GetCost and GetDangerRating? if(HasAttr(AttrType.BLIND) && next != tile()){ return true; } if(HasAttr(AttrType.BURNING,AttrType.POISONED,AttrType.ACIDIFIED)){ return true; } if(HasAttr(AttrType.BLEEDING) && !HasAttr(AttrType.BANDAGED,AttrType.NONLIVING)){ return true; } if(next.IsKnownTrap() && !next.name.Contains("safe") && (!HasAttr(AttrType.FLYING) || HasAttr(AttrType.DESCENDING))){ return true; } if(GetDangerRating(next) > 0){ return true; } if(next.Is(FeatureType.FORASECT_EGG,FeatureType.STABLE_TELEPORTAL,FeatureType.TELEPORTAL,FeatureType.CONFUSION_GAS,FeatureType.THICK_DUST)){ return true; //todo: remove some of these once they're added to GetDangerRating } foreach(Tile t in next.TilesWithinDistance(3)){ //could calculate and store these to prevent checking so many tiles each step. if(t.Is(TileType.POISON_GAS_VENT,TileType.FIRE_GEYSER) && t.seen && next.HasLOE(t)){ return true; } if(t.inv != null && t.inv.type == ConsumableType.BLAST_FUNGUS && t.seen && next.HasLOE(t)){ return true; } } foreach(Actor a in M.AllActors()){ if(a != this && (!a.Is(ActorType.CARNIVOROUS_BRAMBLE,ActorType.MUD_TENTACLE) || next.DistanceFrom(a) <= 1) && CanSee(a) && HasLOS(a)){ return true; } } return false; }