private static ColorGlyph DetermineVisibleColorGlyph(TileType tile, FeatureType features, ItemType?item, ulong currentDepthSeed, Point p) //todo, add trap, shrine, etc. //todo features { if (item != null) { return(GameObjectGlyphs.Get(item.Value)); } if (features.HasFeature(FeatureType.Ice)) { return(GameObjectGlyphs.Get(FeatureType.Ice)); // new ColorGlyph('~', Color.Cyan, Color.Gray); } if (features.HasFeature(FeatureType.CrackedIce)) { return(new ColorGlyph('~', Color.Red, Color.Gray)); } if (features.HasFeature(FeatureType.BrokenIce)) { return(new ColorGlyph('~', Color.Gray, Color.DarkBlue)); } if (features.HasFeature(FeatureType.Water)) { return(new ColorGlyph('~', Color.Cyan, Color.DarkCyan)); } //todo, should change color for creatures based on background, right? do I need rules for which colors to modify/invert? //so... if background color... then return a modified version. //bg colors are currently black, gray, dark blue... plus targeting/mouseover stuff. return(GameObjectGlyphs.Get(tile, currentDepthSeed, p)); }
private static ColorGlyph DetermineCreatureColorGlyph(CreatureType creature, TileType tile, FeatureType features, ItemType?item) { //todo, add trap, shrine, etc. //todo features Color bgColor = Color.Black; if (features.HasFeature(FeatureType.Water)) { bgColor = Color.DarkCyan; } //else if(features.HasFeature(FeatureType.Lava)) bgColor = Color.DarkRed; else if (tile == TileType.ThickIce) { bgColor = Color.Gray; } else if (tile == TileType.DeepWater) { if (features.HasFeature(FeatureType.Ice) || features.HasFeature(FeatureType.CrackedIce)) { bgColor = Color.Gray; } else { bgColor = Color.DarkBlue; } } ColorGlyph cg = GameObjectGlyphs.Get(creature); return(new ColorGlyph(cg.GlyphIndex, cg.ForegroundColor, bgColor)); }
protected override SimpleEvent.NullResult Execute() { // Cracked ice might break. The chance is lower based on how much solid ground & non-cracked ice is adjacent. int chance = 1; foreach (Point neighbor in Point.GetNeighbors()) { TileType tt = TileTypeAt(neighbor); if (tt != TileType.DeepWater) { continue; } FeatureType ft = FeaturesAt(neighbor); if (ft.HasFeature(FeatureType.Ice)) { continue; } else { chance++; } } if (R.FractionalChance(chance, 9)) { Q.Execute(new IceBreakingEvent(Point, GameUniverse)); } return(null); }
///<summary>Null means no light radius, while a radius of 0 will illuminate only this feature's cell.</summary> public static int?LightRadius(this FeatureType feature) //todo, not used yet, right? { if (feature.HasFeature(FeatureType.Fire)) { return(1); } return(null); }