Example #1
0
 public bool ConfirmsSafetyPrompts(Tile t)
 {
     if(CanSee(t) && !HasAttr(AttrType.CONFUSED)){
         if(t.IsKnownTrap() && !HasAttr(AttrType.FLYING,AttrType.BRUTISH_STRENGTH) && !t.name.Contains("(safe)")){
             if(!B.YesOrNoPrompt("Really step on " + t.TheName(true) + "?")){
                 return false;
             }
         }
         if(t.IsBurning() && !IsBurning() && !HasAttr(AttrType.SLIMED,AttrType.NONLIVING)){ //nonliving indicates stoneform
             if(!B.YesOrNoPrompt("Really walk into the fire?")){
                 return false;
             }
         }
         if(HasAttr(AttrType.OIL_COVERED) && !HasAttr(AttrType.IMMUNE_BURNING,AttrType.IMMUNE_FIRE)){
             bool fire = false;
             foreach(Tile t2 in t.TilesWithinDistance(1)){
                 if((t2.actor() != null && t2.actor().IsBurning()) || t2.IsBurning()){
                     fire = true;
                     break;
                 }
             }
             if(fire && !B.YesOrNoPrompt("Really step next to the fire?")){
                 return false;
             }
         }
         if(t.Is(FeatureType.WEB) && !HasAttr(AttrType.SLIMED,AttrType.OIL_COVERED,AttrType.BRUTISH_STRENGTH) && !B.YesOrNoPrompt("Really walk into the web?")){
             return false;
         }
         if(!HasAttr(AttrType.NONLIVING)){
             if(t.Is(FeatureType.CONFUSION_GAS) && !B.YesOrNoPrompt("Really walk into the confusion gas?")){
                 return false;
             }
             if(t.Is(FeatureType.POISON_GAS) && !HasAttr(AttrType.POISONED) && !B.YesOrNoPrompt("Really walk into the poison gas?")){
                 return false;
             }
             if(t.Is(FeatureType.SPORES) && (!HasAttr(AttrType.POISONED) || !HasAttr(AttrType.STUNNED)) && !B.YesOrNoPrompt("Really walk into the spores?")){
                 return false;
             }
             if(t.Is(FeatureType.THICK_DUST) && !B.YesOrNoPrompt("Really walk into the cloud of dust?")){
                 return false;
             }
         }
     }
     return true;
 }
 public static void Targeting_DisplayContents(Tile tc,string always_displayed,string unseen_area_message,bool include_monsters,bool first_iteration)
 {
     if(always_displayed == ""){
         if(include_monsters && tc.actor() == player){
             if(!first_iteration){
                 string s = "You're standing here. ";
                 //if(tc.ContentsCount() == 0 && tc.type == TileType.FLOOR){
                 if(tc.ContentsCount() == 0 && tc.name == "floor"){
                     B.DisplayNow(s);
                 }
                 else{
                     B.DisplayNow(s + tc.ContentsString() + " here. ");
                 }
             }
         }
         else{
             if(player.CanSee(tc)){
                 B.DisplayNow(tc.ContentsString(include_monsters) + ". ");
                 if(!Help.displayed[TutorialTopic.Traps] && tc.IsKnownTrap()){
                     Help.TutorialTip(TutorialTopic.Traps);
                 }
                 else{
                     if(!Help.displayed[TutorialTopic.NotRevealedByLight] && ((tc.IsShrine() || tc.IsKnownTrap()) && !tc.revealed_by_light) || (tc.inv != null && !tc.inv.revealed_by_light)){
                         Help.TutorialTip(TutorialTopic.NotRevealedByLight);
                     }
                     else{
                         if(!Help.displayed[TutorialTopic.Fire] && tc.Is(FeatureType.FIRE)){
                             Help.TutorialTip(TutorialTopic.Fire);
                         }
                         else{
                             switch(tc.type){
                             case TileType.BLAST_FUNGUS:
                             Help.TutorialTip(TutorialTopic.BlastFungus,true);
                             break;
                             case TileType.CRACKED_WALL:
                             Help.TutorialTip(TutorialTopic.CrackedWall,true);
                             break;
                             case TileType.FIREPIT:
                             Help.TutorialTip(TutorialTopic.FirePit,true);
                             break;
                             case TileType.POOL_OF_RESTORATION:
                             Help.TutorialTip(TutorialTopic.PoolOfRestoration,true);
                             break;
                             case TileType.STONE_SLAB:
                             case TileType.STONE_SLAB_OPEN:
                             Help.TutorialTip(TutorialTopic.StoneSlab,true);
                             break;
                             case TileType.COMBAT_SHRINE:
                             case TileType.DEFENSE_SHRINE:
                             case TileType.MAGIC_SHRINE:
                             case TileType.SPIRIT_SHRINE:
                             case TileType.STEALTH_SHRINE:
                             Help.TutorialTip(TutorialTopic.Shrines,true);
                             break;
                             }
                         }
                     }
                 }
             }
             else{
                 if(include_monsters && tc.actor() != null && player.CanSee(tc.actor())){
                     B.DisplayNow("You sense " + tc.actor().a_name + " " + tc.actor().WoundStatus() + ". ");
                 }
                 else{
                     if(tc.seen){
                         if(tc.inv != null){
                             char itemch = tc.inv.symbol;
                             char screench = Screen.MapChar(tc.row,tc.col).c;
                             if(itemch == screench){ //hacky, but it seems to work (when a monster drops an item you haven't seen yet)
                                 if(tc.inv.quantity > 1){
                                     B.DisplayNow("You can no longer see these " + tc.inv.Name(true) + ". ");
                                 }
                                 else{
                                     B.DisplayNow("You can no longer see this " + tc.inv.Name(true) + ". ");
                                 }
                             }
                             else{
                                 B.DisplayNow("You can no longer see this " + tc.Name(true) + ". ");
                             }
                         }
                         else{
                             B.DisplayNow("You can no longer see this " + tc.Name(true) + ". ");
                         }
                     }
                     else{
                         B.DisplayNow(unseen_area_message);
                     }
                 }
             }
         }
     }
     else{
         B.DisplayNow(always_displayed);
     }
 }
Example #3
0
 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;
 }