Exemplo n.º 1
0
 public void PickUpFrom(MonsterID appearance, CharAnimation prevAnim)
 {
     AnimRushTime   = GraphicsManager.GetChara(appearance).GetRushTime(AnimFrameType, CharDir);
     AnimHitTime    = GraphicsManager.GetChara(appearance).GetHitTime(AnimFrameType, CharDir);
     AnimReturnTime = GraphicsManager.GetChara(appearance).GetReturnTime(AnimFrameType, CharDir);
     AnimTotalTime  = GraphicsManager.GetChara(appearance).GetTotalTime(AnimFrameType, CharDir);
     if (prevAnim.TakesPrevActionTime() && TakesPrevActionTime())
     {
         PrevActionTime = prevAnim.AddPrevActionTime();
     }
 }
Exemplo n.º 2
0
        public Character CreatePlayer(ReRandom rand, MonsterID form, int level, int intrinsic, int personality)
        {
            MonsterID   formData = form;
            MonsterData dex      = DataManager.Instance.GetMonster(formData.Species);

            CharData character = new CharData();

            character.BaseForm = formData;
            character.Level    = level;

            BaseMonsterForm formEntry = dex.Forms[formData.Form];

            List <int> final_skills = formEntry.RollLatestSkills(character.Level, new List <int>());

            for (int ii = 0; ii < final_skills.Count; ii++)
            {
                character.BaseSkills[ii] = new SlotSkill(final_skills[ii]);
            }

            if (form.Gender == Gender.Unknown)
            {
                character.BaseForm.Gender = dex.Forms[formData.Form].RollGender(rand);
            }

            if (intrinsic == -1)
            {
                character.BaseIntrinsics[0] = formEntry.RollIntrinsic(rand, 2);
            }
            else
            {
                character.BaseIntrinsics[0] = intrinsic;
            }

            if (personality == -1)
            {
                character.Discriminator = rand.Next();
            }
            else
            {
                character.Discriminator = personality;
            }


            character.OriginalUUID = DataManager.Instance.Save.UUID;
            character.OriginalTeam = DataManager.Instance.Save.ActiveTeam.Name;
            character.MetAt        = Text.FormatKey("MET_AT_START");

            return(CreatePlayer(character));
        }
Exemplo n.º 3
0
        public virtual void Promote(MonsterID data)
        {
            MonsterData     dex  = DataManager.Instance.GetMonster(BaseForm.Species);
            BaseMonsterForm form = dex.Forms[BaseForm.Form];

            BaseForm = data;

            int prevIndex = 0;

            if (form.Intrinsic2 == BaseIntrinsics[0])
            {
                prevIndex = 1;
            }
            else if (form.Intrinsic3 == BaseIntrinsics[0])
            {
                prevIndex = 2;
            }

            BaseIntrinsics.Clear();

            MonsterData     newDex  = DataManager.Instance.GetMonster(BaseForm.Species);
            BaseMonsterForm newForm = newDex.Forms[BaseForm.Form];

            if (prevIndex == 2 && newForm.Intrinsic3 == 0)
            {
                prevIndex = 0;
            }
            if (prevIndex == 1 && newForm.Intrinsic2 == 0)
            {
                prevIndex = 0;
            }

            if (prevIndex == 0)
            {
                BaseIntrinsics.Add(newForm.Intrinsic1);
            }
            else if (prevIndex == 1)
            {
                BaseIntrinsics.Add(newForm.Intrinsic2);
            }
            else if (prevIndex == 2)
            {
                BaseIntrinsics.Add(newForm.Intrinsic3);
            }
        }
Exemplo n.º 4
0
        public void Update(FrameTick elapsedTime, MonsterID appearance, int movementSpeed)
        {
            if (TakesMovementSpeed())
            {
                if (movementSpeed < 0)
                {
                    elapsedTime /= 2;
                }
                else if (movementSpeed > 0)
                {
                    elapsedTime *= 2;
                }
            }

            ActionTime += elapsedTime;

            UpdateInternal();
        }
Exemplo n.º 5
0
        public static string GetFullFormName(MonsterID id)
        {
            string   name = DataManager.Instance.DataIndices[DataManager.DataType.Monster].Entries[id.Species].Name.ToLocal();
            SkinData data = DataManager.Instance.GetSkin(id.Skin);

            if (data.Symbol != '\0')
            {
                name = data.Symbol + name;
            }
            if (id.Gender != Gender.Genderless)
            {
                char genderChar = (id.Gender == Gender.Male) ? '\u2642' : '\u2640';
                if (name[name.Length - 1] != genderChar)
                {
                    name += genderChar;
                }
            }
            return(name);
        }
Exemplo n.º 6
0
        public bool Equals(MonsterID other)
        {
            if (Species != other.Species)
            {
                return(false);
            }
            if (Form != other.Form)
            {
                return(false);
            }
            if (Skin != other.Skin)
            {
                return(false);
            }
            if (Gender != other.Gender)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
        public CharData(CharData other)
        {
            //clean variables
            Nickname = other.Nickname;
            BaseForm = other.BaseForm;
            Level    = other.Level;

            MaxHPBonus = other.MaxHPBonus;
            AtkBonus   = other.AtkBonus;
            DefBonus   = other.DefBonus;
            MAtkBonus  = other.MAtkBonus;
            MDefBonus  = other.MDefBonus;
            SpeedBonus = other.SpeedBonus;

            BaseSkills = new List <SlotSkill>();
            foreach (SlotSkill skill in other.BaseSkills)
            {
                BaseSkills.Add(new SlotSkill(skill));
            }
            BaseIntrinsics = new List <int>();
            BaseIntrinsics.AddRange(other.BaseIntrinsics);
            Relearnables = new List <bool>();
            Relearnables.AddRange(other.Relearnables);

            OriginalUUID = other.OriginalUUID;
            OriginalTeam = other.OriginalTeam;
            MetAt        = other.MetAt;
            //MetDungeon = other.MetDungeon;
            //MetFloor = other.MetFloor;
            DefeatAt = other.DefeatAt;
            //FaintDungeon = other.FaintDungeon;
            //FaintFloor = other.FaintFloor;
            IsFounder     = other.IsFounder;
            IsFavorite    = other.IsFavorite;
            Discriminator = other.Discriminator;

            //TODO: deep copy?
            LuaDataTable = other.LuaDataTable;
        }
Exemplo n.º 8
0
 public EXPGain(MonsterID slain, int level)
 {
     SlainMonster = slain;
     Level        = level;
 }