Пример #1
0
        public ActorModel(string imageID, string name, string pluralName, int scoreValue, DollBody body, Abilities abilities, ActorSheet startingSheet, Type defaultController)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (body == null)
            {
                throw new ArgumentNullException("body");
            }
            if (abilities == null)
            {
                throw new ArgumentNullException("abilities");
            }
            if (startingSheet == null)
            {
                throw new ArgumentNullException("startingSheet");
            }
            if (defaultController != null && !defaultController.IsSubclassOf(typeof(ActorController)))
            {
                throw new ArgumentException("defaultController is not a subclass of ActorController");
            }

            m_ImageID           = imageID;
            m_DollBody          = body;
            m_Name              = name;
            m_PluralName        = pluralName;
            m_StartingSheet     = startingSheet;
            m_Abilities         = abilities;
            m_DefaultController = defaultController;
            m_ScoreValue        = scoreValue;
            m_CreatedCount      = 0;
        }
Пример #2
0
        void OnModelSet()
        {
            ActorModel model = this.Model;

            m_Doll  = new Doll(model.DollBody);
            m_Sheet = new ActorSheet(model.StartingSheet);

            // starting points maxed.
            m_ActionPoints  = m_Doll.Body.Speed;
            m_HitPoints     = m_previousHitPoints = m_Sheet.BaseHitPoints;
            m_StaminaPoints = m_previousStamina = m_Sheet.BaseStaminaPoints;
            m_FoodPoints    = m_previousFoodPoints = m_Sheet.BaseFoodPoints;
            m_SleepPoints   = m_previousSleepPoints = m_Sheet.BaseSleepPoints;
            m_Sanity        = m_previousSanity = m_Sheet.BaseSanity;

            // create inventory.
            if (model.Abilities.HasInventory)
            {
                m_Inventory = new Inventory(model.StartingSheet.BaseInventoryCapacity);
            }

            // starting attacks.
            m_CurrentMeleeAttack  = model.StartingSheet.UnarmedAttack;
            m_CurrentDefence      = model.StartingSheet.BaseDefence;
            m_CurrentRangedAttack = Attack.BLANK;
        }
Пример #3
0
        public ActorSheet(ActorSheet copyFrom)
        {
            if (copyFrom == null)
            {
                throw new ArgumentNullException("copyFrom");
            }

            this.BaseHitPoints         = copyFrom.BaseHitPoints;
            this.BaseStaminaPoints     = copyFrom.BaseStaminaPoints;
            this.BaseFoodPoints        = copyFrom.BaseFoodPoints;
            this.BaseSleepPoints       = copyFrom.BaseSleepPoints;
            this.BaseSanity            = copyFrom.BaseSanity;
            this.UnarmedAttack         = copyFrom.UnarmedAttack;
            this.BaseDefence           = copyFrom.BaseDefence;
            this.BaseViewRange         = copyFrom.BaseViewRange;
            this.BaseAudioRange        = copyFrom.BaseAudioRange;
            this.BaseSmellRating       = copyFrom.BaseSmellRating;
            this.BaseInventoryCapacity = copyFrom.BaseInventoryCapacity;

            if (copyFrom.SkillTable.Skills != null)
            {
                m_SkillTable = new SkillTable(copyFrom.SkillTable.Skills);
            }
        }