Exemple #1
0
 public AICharacter(string name,
                    int currentPf,
                    int maximumPf,
                    int hunger,
                    AI intelligence,
                    int perceptionDistance,
                    AI.SensingMethod sensingMethod = null,
                    Stats?stats           = null,
                    Armor wornArmor       = null,
                    Shield embracedShield = null,
                    Weapon handledWeapon  = null,
                    Backpack backpack     = null,
                    God god            = null,
                    bool unblockable   = false,
                    string symbol      = "C",
                    Color?color        = null,
                    string description = "A creature of the world",
                    Coord position     = new Coord(),
                    Allied hostile     = Allied.Enemy)
     : base(name,
            currentPf,
            maximumPf,
            hunger,
            stats == null ? new Stats(StatsBuilder.RandomStats()) : (Stats)stats,
            wornArmor,
            embracedShield,
            handledWeapon,
            backpack == null ? new Backpack() : backpack,
            god,
            unblockable,
            symbol,
            color == null
                 ? (hostile == Allied.Enemy ? Color.Red : Color.Green)
                 : (Color)color,
            description,
            position)
 {
     this.intelligence = intelligence;
     this.SensePg      = sensingMethod == null ? AI.SensingAlgorythms.AllAround : sensingMethod;
     this.intelligence.ControlledCharacter = this;
     this.PerceptionDistance = perceptionDistance;
     this.AlliedTo           = hostile;
 }
Exemple #2
0
        public PgCreator()
        {
            Name  = RandomName();
            Stats = new Stats(StatsBuilder.RandomStats());
            var toughMod = Stats[StatsType.Toughness].ModifierOfStat();

            Level           = Pg.Level.Novice;
            CurrentXp       = Pg.XpForLevel(Level);
            NextXp          = Pg.XpForLevel(Level.Next());
            CurrentPf       = Pg.healthDice.Max + toughMod;
            MaxPf           = Pg.healthDice.Max + toughMod;
            Hunger          = Pg.hungerDice.Max * Math.Max(1, toughMod);
            Armor           = null;
            Shield          = null;
            Weapon          = null;
            Backpack        = new Backpack();
            Spellbook       = new Spellbook();
            Symbol          = "@";
            Color           = Color.White;
            God             = null;
            Unblockable     = false;
            PerceptionRange = 10;
        }