Пример #1
0
        public void InitCharacter(string name, EntityAttribute attributes, int hp = 100)
        {
            m_attribute = attributes;
            EntityName  = name;
            Hash        = EntityManager.Instance.AddEntity(this);
            if (EntityBuffManager == null)
            {
                EntityBuffManager = new BuffManager(Hash);
            }
            HealthPoints         = hp;
            PhysicalArmourPoints = 0;
            MagicalArmourPoints  = 0;
            ActionPoints         = 0;
            IsDeath = false;

            m_collider.enabled = true;
        }
Пример #2
0
        public virtual bool CastSkill(int skillID, Location castLoc)
        {
            if (!EntityBuffManager.Castable)
            {
                return(false);
            }
            BaseSkill tSkill = SkillHashes[skillID].GetBaseSkill();

            if (ActionPoints < tSkill.actionPointsCost)
            {
                return(false);
            }
            ImpactActionPoints(tSkill.actionPointsCost, true);

            tSkill.ApplyEffect(Hash, Loc, castLoc, true);
            tempAttribute = new EntityAttribute();
            return(true);
        }
Пример #3
0
        public void CreateNewGame(int raceID, int classID)
        {
            m_playerData[SelectSlot].isNewGame = false;
            TRace      tRace     = ActivePlayerData.unlockedRaces[raceID].GetTRace();
            TClass     tClass    = ActivePlayerData.unlockedClasses[classID].GetTClass();
            List <int> skillDeck = new List <int>();

            for (int i = 0; i < 5; i++)
            {
                skillDeck.Add(tClass.skillSet[0].Hash);
            }
            for (int i = 0; i < 4; i++)
            {
                skillDeck.Add(tClass.skillSet[1].Hash);
            }
            skillDeck.Add(tRace.skill.Hash);
            EntityAttribute attribute = (tRace.attribute + tClass.attribute) / 2;

            m_activeWorldData = new WorldData()
            {
                seed              = System.DateTime.Now.ToString(),
                selectClassID     = classID,
                selectRaceID      = raceID,
                attribute         = attribute,
                HealthPoints      = attribute.maxHealth,
                gainedRelicHashes = new List <int>()
                {
                    classID.GetTClassFromID().relic.Hash,
                                              raceID.GetTRaceFromID().relic.Hash
                },
                learnedSkillHashes = skillDeck,
                worldMap           = new List <Location>(),
                stageLocations     = new List <Location>(),
                currentStage       = 0,
                characterLocation  = new Location(4, 0),
                enterAreaDirection = Location.Up,
                worldBound         = new Location(8, -1)
            };
            AreaChunks = new AreaData[0];

            sr = new System.Random(ActiveWorldData.seed.GetStableHashCode());
            //SaveAll();
        }
Пример #4
0
 public override void ImpactAttribute(EntityAttribute value)
 {
     base.ImpactAttribute(value);
     Database.Instance.SetCharacterData(m_attribute);
     Database.Instance.SetCharacterData(HealthPoints + value.maxHealth);
 }
Пример #5
0
 public void SetCharacterData(EntityAttribute attribute)
 {
     m_activeWorldData.attribute = attribute;
     WorldDataChangedEvent?.Invoke();
 }
Пример #6
0
 public virtual void ImpactAttribute(EntityAttribute value)
 {
     m_attribute += value;
 }
Пример #7
0
 public virtual void SetTempAttribute(EntityAttribute temp)
 {
     tempAttribute = temp;
 }