/// <summary> /// Modifies daytime visibility based on time of day and racewar side. /// </summary> /// <param name="racewarside"></param> /// <returns></returns> public static int GetDaytimeVisibilityModifier(Race.RacewarSide racewarside) { switch( Database.SystemData.WeatherData.Sunlight ) { case SunType.night: case SunType.moonset: case SunType.moonrise: if( racewarside == Race.RacewarSide.evil ) return 4; if( racewarside == Race.RacewarSide.good ) return 0; return 2; case SunType.sunset: case SunType.sunrise: if( racewarside == Race.RacewarSide.evil ) return 1; if( racewarside == Race.RacewarSide.good ) return 2; return 2; case SunType.daytime: if( racewarside == Race.RacewarSide.evil ) return 0; if( racewarside == Race.RacewarSide.good ) return 4; return 2; default: return 0; } }
/// <summary> /// Default constructor. /// </summary> public RepopulationPoint() { _roomIndexNumber = 0; _raceString = String.Empty; _classString = String.Empty; _race = null; _class = null; }
/// <summary> /// Gets colorized text for the name of a racewar side. /// </summary> /// <param name="value"></param> /// <returns></returns> public static string RacewarSideColorString( Race.RacewarSide value ) { switch( value ) { case Race.RacewarSide.enslaver: return "&+rEnslaver&n"; case Race.RacewarSide.good: return "&+yGood&n"; case Race.RacewarSide.evil: return "&+REvil&n"; case Race.RacewarSide.neutral: return "&+wNeutral&n"; default: return "&+WBuggy&n"; } }
/// <summary> /// Gets racewar side as a string. /// </summary> /// <param name="value"></param> /// <returns></returns> public static string RacewarSideBWString( Race.RacewarSide value ) { switch( value ) { case Race.RacewarSide.enslaver: return "enslaver"; case Race.RacewarSide.good: return "good"; case Race.RacewarSide.evil: return "evil"; case Race.RacewarSide.neutral: return "neutral"; default: return "buggy"; } }
/// <summary> /// Returs the ASCII _name of a body part vector. /// </summary> /// <param name="vector"></param> /// <returns></returns> public static string PartsBitString( Race.Parts vector ) { string text = String.Empty; if( ( vector & Race.Parts.skull ) != 0 ) text += " head"; if( (vector & Race.Parts.arms) != 0 ) text += " arms"; if( (vector & Race.Parts.legs) != 0 ) text += " legs"; if( (vector & Race.Parts.heart) != 0 ) text += " heart"; if( (vector & Race.Parts.brains) != 0 ) text += " brains"; if( (vector & Race.Parts.guts) != 0 ) text += " guts"; if( (vector & Race.Parts.hands) != 0 ) text += " hands"; if( (vector & Race.Parts.feet) != 0 ) text += " feet"; if( (vector & Race.Parts.fingers) != 0 ) text += " fingers"; if( (vector & Race.Parts.ears) != 0 ) text += " ears"; if( (vector & Race.Parts.eyes) != 0 ) text += " eyes"; if( (vector & Race.Parts.tongue) != 0 ) text += " tongue"; if( (vector & Race.Parts.eyestalks) != 0 ) text += " eyestalks"; if( (vector & Race.Parts.tentacles) != 0 ) text += " tentacles"; if( (vector & Race.Parts.fins) != 0 ) text += " fins"; if( (vector & Race.Parts.wings) != 0 ) text += " wings"; if( (vector & Race.Parts.tail) != 0 ) text += " tail"; if( (vector & Race.Parts.claws) != 0 ) text += " claws"; if( (vector & Race.Parts.fangs) != 0 ) text += " fangs"; if( (vector & Race.Parts.horns) != 0 ) text += " horns"; if( (vector & Race.Parts.scales) != 0 ) text += " scales"; if( (vector & Race.Parts.tusks) != 0 ) text += " tusks"; if( (vector & Race.Parts.leaves) != 0 ) text += " leaves"; if( (vector & Race.Parts.branches) != 0 ) text += " branches"; if( (vector & Race.Parts.bark) != 0 ) text += " bark"; if( (vector & Race.Parts.trunk) != 0 ) text += " trunk"; if( text.Length < 1 ) { return "none"; } text.Remove( 0, 1 ); // Nuke leading space. return text; }
/// <summary> /// Get the string representation of a language. /// </summary> /// <param name="value"></param> /// <returns></returns> public static string LanguageString( Race.Language value ) { if( value == Race.Language.unknown ) return "unknown"; if( value == Race.Language.common ) return "common"; if( value == Race.Language.elven ) return "elven"; if( value == Race.Language.dwarven ) return "dwarven"; if( value == Race.Language.centaur ) return "centaur"; if( value == Race.Language.ogre ) return "ogre"; if( value == Race.Language.orcish ) return "orcish"; if( value == Race.Language.troll ) return "troll"; if( value == Race.Language.aquaticelf ) return "aquaticelf"; if( value == Race.Language.neogi ) return "neogi"; if( value == Race.Language.thri ) return "thri-kreen"; if( value == Race.Language.dragon ) return "dragon"; if( value == Race.Language.magical ) return "magic"; if( value == Race.Language.goblin ) return "goblin"; if( value == Race.Language.god ) return "god"; if( value == Race.Language.halfling ) return "halfling"; if( value == Race.Language.githyanki ) return "githyanki"; if( value == Race.Language.drow ) return "drow"; if( value == Race.Language.kobold ) return "kobold"; if( value == Race.Language.gnome ) return "gnome"; if( value == Race.Language.animal ) return "animal"; if( value == Race.Language.duergar ) return "duergar"; if( value == Race.Language.githzerai ) return "githzerai"; if( value == Race.Language.gnoll ) return "gnoll"; if( value == Race.Language.rakshasa ) return "rakshasa"; if( value == Race.Language.minotaur ) return "minotaur"; if( value == Race.Language.illithid ) return "illithid"; if( value == Race.Language.barbarian ) return "barbarian"; return "invalid_language"; }
/// <summary> /// Returns the ASCII name of a RISV damage type. /// </summary> /// <param name="vector"></param> /// <returns></returns> public static string DamageTypeString( Race.DamageType vector ) { string text = String.Empty; if( (vector & Race.DamageType.fire) != 0 ) text += " fire"; if( (vector & Race.DamageType.cold) != 0 ) text += " cold"; if( (vector & Race.DamageType.electricity) != 0 ) text += " electricity"; if( (vector & Race.DamageType.energy) != 0 ) text += " energy"; if( (vector & Race.DamageType.acid) != 0 ) text += " acid"; if( (vector & Race.DamageType.poison) != 0 ) text += " poison"; if( (vector & Race.DamageType.charm) != 0 ) text += " charm"; if( (vector & Race.DamageType.mental) != 0 ) text += " mental"; if( (vector & Race.DamageType.whiteMana) != 0 ) text += " white_mana"; if( (vector & Race.DamageType.blackMana) != 0 ) text += " black_mana"; if( (vector & Race.DamageType.disease) != 0 ) text += " disease"; if( (vector & Race.DamageType.drowning) != 0 ) text += " drowning"; if( (vector & Race.DamageType.light) != 0 ) text += " light"; if( (vector & Race.DamageType.sound) != 0 ) text += " sound"; if( (vector & Race.DamageType.magic) != 0 ) text += " magic"; if( (vector & Race.DamageType.nonmagic) != 0 ) text += " nonmagic"; if( (vector & Race.DamageType.silver) != 0 ) text += " silver"; if( (vector & Race.DamageType.iron) != 0 ) text += " iron"; if( (vector & Race.DamageType.wood) != 0 ) text += " wood"; if( (vector & Race.DamageType.weapon) != 0 ) text += " weapon"; if( (vector & Race.DamageType.bash) != 0 ) text += " bash"; if( (vector & Race.DamageType.pierce) != 0 ) text += " pierce"; if( (vector & Race.DamageType.slash) != 0 ) text += " slash"; if( text.Length < 1 ) { return "none"; } text.Remove( 0, 1 ); // Clear leading space. return text; }
/// <summary> /// Modifies underground visibility based on time of day and racewar side. /// </summary> /// <param name="racewarside"></param> /// <returns></returns> public static int GetUnderdarkVisibilityModifier( Race.RacewarSide racewarside ) { switch( racewarside ) { case Race.RacewarSide.evil: return 4; case Race.RacewarSide.good: return 0; default: return 2; } }
/// <summary> /// Checks whether char is vulnerable to the supplied damage type. /// </summary> /// <param name="ch"></param> /// <param name="bit"></param> /// <returns></returns> public static bool CheckVulnerable(CharData ch, Race.DamageType bit) { return (Macros.IsSet((int)ch.Vulnerable | (int)Race.RaceList[ch.GetRace()].Vulnerable, (int)bit)); }
/// <summary> /// Checks whether char is resistant to the supplied damage type. /// </summary> /// <param name="ch"></param> /// <param name="bit"></param> /// <returns></returns> public static bool CheckResistant( CharData ch, Race.DamageType bit ) { return ( Macros.IsSet( (int)ch.Resistant | (int)Race.RaceList[ ch.GetRace() ].Resistant, (int)bit ) ); }
/// <summary> /// Checks whether char is immune to the supplied damage type. /// </summary> /// <param name="ch"></param> /// <param name="bit"></param> /// <returns></returns> public static bool CheckImmune( CharData ch, Race.DamageType bit ) { return ( Macros.IsSet( (int)ch.Immune | (int)Race.RaceList[ ch.GetRace() ].Immune, (int)bit ) ); }
public void PracticeLanguage( Race.Language lang ) { if( IsNPC() ) { return; } // Have to be below 100 and above 0 and make a successful // lang check and be able to learn the lang. if( ( (PC)this ).LanguageAptitude[ (int)lang ] < 100 && ( (PC)this ).LanguageAptitude[ (int)lang ] > 0 && MUDMath.NumberRange( 1, 1000 ) <= ( 5 + GetCurrInt() ) ) { ( (PC)this ).LanguageAptitude[ (int)lang ]++; string buf = "&+cYe feel yer knowledge of " + Race.LanguageTable[ (int)lang ] + " improving.&n\r\n"; if( ( (PC)this ).LanguageAptitude[ (int)lang ] >= 20 && IsImmortal() ) { SendText( buf ); } } return; }
/// <summary> /// Checks whether a character is able to speak a particular language. /// </summary> /// <param name="lang"></param> /// <returns></returns> public bool CanSpeakLanguage(Race.Language lang) { if (lang < 0 || (int)lang > Race.MAX_LANG) return false; if (lang == Race.Language.unknown && !IsImmortal() && !IsNPC()) return false; if (IsNPC()) return false; if (((PC)this).LanguageAptitude[(int)lang] > 19) return true; return false; }
/// <summary> /// Sets race and class on a repop by looking up the race and class. /// </summary> public void Setup() { _race = Race.RaceList[Race.RaceLookup(_raceString)]; _class = CharClass.ClassList[(int)CharClass.ClassLookup(_classString)]; }