Esempio n. 1
0
        public bool Equals(DestinyHistoricalStatsPerCharacter input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                     ) &&
                 (
                     Deleted == input.Deleted ||
                     (Deleted != null && Deleted.Equals(input.Deleted))
                 ) &&
                 (
                     Results == input.Results ||
                     (Results != null && Results.SequenceEqual(input.Results))
                 ) &&
                 (
                     Merged == input.Merged ||
                     (Merged != null && Merged.Equals(input.Merged))
                 ));
        }
Esempio n. 2
0
        public void SetCookies(IEnumerable <string> cookies)
        {
            notNullReference.Check(cookies, "cookies");

            enemyId    = new CharacterId(cookies.ElementAt(0));
            enemyCount = Convert.ToInt32(cookies.ElementAt(1));
        }
Esempio n. 3
0
    public void SetCharacterToDisplay(CharacterId character)
    {
        _currentCharacter = character;
        Debug.Log($"Displaying character info for {_currentCharacter.ToString()}");

        DisplayPortrait();
    }
Esempio n. 4
0
    public static void FF9Play_New(Int32 slot_id)
    {
        PLAYER play = FF9StateSystem.Common.FF9.player[slot_id];

        PLAYER_INFO[] playerInfoArray =
        {
            new PLAYER_INFO(CharacterIndex.Zidane,  1, 1, 1, 0,  0),
            new PLAYER_INFO(1,                      2, 0, 1, 0,  1),
            new PLAYER_INFO(2,                      3, 0, 1, 0,  2),
            new PLAYER_INFO(3,                      7, 1, 1, 0,  3),
            new PLAYER_INFO(4,                     12, 0, 1, 0,  4),
            new PLAYER_INFO(5,                     14, 1, 1, 0,  8),
            new PLAYER_INFO(6,                     15, 1, 1, 0, 10),
            new PLAYER_INFO(7,                     16, 1, 1, 0, 12),
            new PLAYER_INFO(8,                     18, 1, 1, 0, 14)
        };
        play.info     = playerInfoArray[slot_id];
        play.status   = 0;
        play.category = (Byte)FF9Play_GetCategory(play.info.menu_type);
        play.bonus    = new FF9LEVEL_BONUS();
        CharacterId charId3 = FF9Play_GetCharID2(play.Index, play.IsSubCharacter);

        play.name = FF9TextTool.CharacterDefaultName(play.info.menu_type);
        FF9Play_SetDefEquips(play.equip, charId3);
        play.info.serial_no = (Byte)FF9Play_GetSerialID(play.info.slot_no, play.IsSubCharacter, play.equip);
        FF9Play_Build(slot_id, 1, playerInfoArray[slot_id], false);
        play.cur.hp   = play.max.hp;
        play.cur.mp   = play.max.mp;
        play.cur.capa = play.max.capa;
    }
Esempio n. 5
0
        public bool Equals(DestinyLeaderboardEntry input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Rank == input.Rank ||
                     (Rank.Equals(input.Rank))
                     ) &&
                 (
                     Player == input.Player ||
                     (Player != null && Player.Equals(input.Player))
                 ) &&
                 (
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                 ) &&
                 (
                     Value == input.Value ||
                     (Value != null && Value.Equals(input.Value))
                 ));
        }
 public static CharacterTool Open(CharacterId id)
 {
     CloseCurrent();
     Current = Assets._.CampCharacterTool.Instantiate();
     Current.Id = id;
     return Current;
 }
Esempio n. 7
0
        public void BindChracter(CharacterId characterId)
        {
            CharacterId = characterId;

            // TODO: Field script
            Console.WriteLine($"NotImplemented: {nameof(FieldObject)}.{nameof(BindChracter)}({characterId})");
        }
Esempio n. 8
0
 public CharacterData Find(CharacterId id)
 {
     var ret = _datas.GetOrDefault(id.ToIndex());
     if (ret == null)
         Debug.LogWarning(LogMessages.KeyNotExists(id));
     return ret;
 }
Esempio n. 9
0
        public void Show(CharacterId character)
        {
            _character = character;

            var skills = SkillBalance._.SelectCharacterSpecifics(character);

            var userSkillSet = new List<SkillKey>();
            var userCharacter = UserCharacters.Find(character);
            if (userCharacter != null) userSkillSet = userCharacter.SkillSet.ToList();

            var i = 0;
            for (; i < _slots.Count && i < skills.Count; ++i)
            {
                var skillKey = skills[i].Key;
                var slot = _slots[i];
                slot.Set(skillKey);
                if (userSkillSet.Contains(skillKey))
                    slot.Select();
                else
                    slot.Deselect();
            }

            for (; i < _slots.Count; ++i)
                _slots[i].Clear();
        }
Esempio n. 10
0
        public bool Equals(DestinyPostGameCarnageReportEntry input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Standing == input.Standing ||
                     (Standing.Equals(input.Standing))
                     ) &&
                 (
                     Score == input.Score ||
                     (Score != null && Score.Equals(input.Score))
                 ) &&
                 (
                     Player == input.Player ||
                     (Player != null && Player.Equals(input.Player))
                 ) &&
                 (
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                 ) &&
                 (
                     Values == input.Values ||
                     (Values != null && Values.SequenceEqual(input.Values))
                 ) &&
                 (
                     Extended == input.Extended ||
                     (Extended != null && Extended.Equals(input.Extended))
                 ));
        }
Esempio n. 11
0
 public CharacterSheet(CharacterId id)
 {
     Id = id;
     if (id.Type is AssetType.Party or AssetType.Monster)
     {
         Inventory = new Inventory(new InventoryId(id));
     }
 }
Esempio n. 12
0
        public void SetCharacter(CharacterId id)
        {
            var data = CharacterDb._.Find(id);
            if (data == null) return;

            Character = id;
            _characterIcon.sprite = R.Character.LoadIcon(id);
            _characterIcon.SetNativeSize();
        }
Esempio n. 13
0
 public void SetCharacter(CharacterId id)
 {
     var characterData = CharacterDb._.Find(id);
     if (characterData == null) return;
     if (CharacterView != null) Destroy(CharacterView.gameObject);
     CharacterView = characterData.CharacterView.Instantiate();
     CharacterView.transform.SetParent(transform, false);
     CharacterView.transform.localPosition = Vector3.zero;
 }
Esempio n. 14
0
    /// <summary>
    /// Gets the character data.
    /// </summary>
    /// <returns>The character data.</returns>
    /// <param name="id">Identifier.</param>
    public CharacterData GetCharacterData(CharacterId id)
    {
        if (m_characterDict.ContainsKey(id))
        {
            return(m_characterDict[id]);
        }

        return(null);
    }
Esempio n. 15
0
        public Teleport(BaseEvent ef, Character caster, Environment environment)
        {
            this.ef          = ef;
            this.caster      = caster;
            this.environment = environment;

            TeleportAction ta = (TeleportAction)ef.action;

            TeleportAction.ModeName mode = ta.mode.ShowModeName();
            switch (mode)
            {
            case TeleportAction.ModeName.PredefinedPositionOnMap:
                TeleportAction.PredefinedPositionOnMapMode ppomm = (TeleportAction.PredefinedPositionOnMapMode)ta.mode;
                Vector2 pos          = environment.GetPositionOnMap(ppomm.positionName);
                Vector2 displacement = pos - (Vector2)caster.Position();
                caster.DisplaceBy(displacement);
                break;

            case TeleportAction.ModeName.KeepDistance:
                TeleportAction.KeepDistanceMode kdm = (TeleportAction.KeepDistanceMode)ta.mode;
                List <Character> enemies            = environment.FindNearbyCharacters(
                    caster, Vector3.zero, 999,
                    new[] {
                    FindingFilter.ExcludeAllies, FindingFilter.ExcludeDead, FindingFilter.ExcludeMe
                }
                    );
                if (enemies.Count > 0)
                {
                    Character   enemy         = enemies[0];
                    CharacterId enemyCharId   = enemy.CharacterId();
                    CharacterId charToControl = environment.CharacterToControl();
                    CharacterId casterCharId  = caster.CharacterId();

                    if (casterCharId != charToControl)
                    {
                        float from            = kdm.distanceRange[0];
                        float to              = kdm.distanceRange[1];
                        float distanceBetween = Math.Abs(enemy.Position().x - caster.Position().x);
                        float distance        = distanceBetween;
                        if (distanceBetween <= from)
                        {
                            distance = from;
                        }
                        else if (distanceBetween >= to)
                        {
                            distance = to;
                        }

                        Vector2 targetPos = (Vector2)enemy.Position() +
                                            enemy.FacingDirection().ToNormalizedVector2() * distance;
                        caster.DisplaceBy(targetPos - (Vector2)caster.Position());
                    }
                }
                break;
            }
        }
Esempio n. 16
0
        public void UseDefaultForMultipleChoiceCharacter(Func <CharacterVerse> getMatchingCharacterForVerse)
        {
            var ids = CharacterId.SplitCharacterId(2);

            if (ids.Length > 1)
            {
                var cv = getMatchingCharacterForVerse();
                CharacterIdInScript = (cv != null && !String.IsNullOrEmpty(cv.DefaultCharacter) ? cv.DefaultCharacter : ids[0]);
            }
        }
Esempio n. 17
0
        public static string ToSkillPath(this HeroConfig.SkillStats skillStats, CharacterId characterId)
        {
            string categoryFolderName     = skillStats.ShowCategory().ShowParentSkillCategory().ToString();
            string pathToSkillFrameConfig = string.Format(
                ResourcePreload.PATH_TO_SKILL_CONFIG_FORMAT,
                characterId.GroupId,
                categoryFolderName,
                skillStats.groupId + "_" + skillStats.name + "_" + skillStats.level
                );

            return(pathToSkillFrameConfig);
        }
Esempio n. 18
0
    public void SetUpEnemyUnits(CharacterId bossId, List <CharacterData> soldiers)
    {
        GameObject[] enemyUnitObjects = GameObject.FindGameObjectsWithTag("EnemyUnit");

        var bossData = ApplyBossBonusToCharacter(DataManager.instance.CurrentState.Characters[bossId]);

        enemyUnitObjects.Single(r => r.name == "EnemyUnit1").GetComponent <UnitStats>().SetUpUnitCharacter(bossData);

        enemyUnitObjects.Single(r => r.name == "EnemyUnit2").GetComponent <UnitStats>().SetUpUnitCharacter(soldiers[0]);
        enemyUnitObjects.Single(r => r.name == "EnemyUnit3").GetComponent <UnitStats>().SetUpUnitCharacter(soldiers[1]);
        enemyUnitObjects.Single(r => r.name == "EnemyUnit4").GetComponent <UnitStats>().SetUpUnitCharacter(soldiers[2]);
    }
Esempio n. 19
0
        public bool Equals(DestinyItemResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                     ) &&
                 (
                     Item == input.Item ||
                     (Item != null && Item.Equals(input.Item))
                 ) &&
                 (
                     Instance == input.Instance ||
                     (Instance != null && Instance.Equals(input.Instance))
                 ) &&
                 (
                     Objectives == input.Objectives ||
                     (Objectives != null && Objectives.Equals(input.Objectives))
                 ) &&
                 (
                     Perks == input.Perks ||
                     (Perks != null && Perks.Equals(input.Perks))
                 ) &&
                 (
                     RenderData == input.RenderData ||
                     (RenderData != null && RenderData.Equals(input.RenderData))
                 ) &&
                 (
                     Stats == input.Stats ||
                     (Stats != null && Stats.Equals(input.Stats))
                 ) &&
                 (
                     TalentGrid == input.TalentGrid ||
                     (TalentGrid != null && TalentGrid.Equals(input.TalentGrid))
                 ) &&
                 (
                     Sockets == input.Sockets ||
                     (Sockets != null && Sockets.Equals(input.Sockets))
                 ) &&
                 (
                     ReusablePlugs == input.ReusablePlugs ||
                     (ReusablePlugs != null && ReusablePlugs.Equals(input.ReusablePlugs))
                 ) &&
                 (
                     PlugObjectives == input.PlugObjectives ||
                     (PlugObjectives != null && PlugObjectives.Equals(input.PlugObjectives))
                 ));
        }
Esempio n. 20
0
    static void DumpCharacterSheet(CharacterId id, CharacterSheet c, StreamWriter sw, IAssetManager assets, ITextFormatter tf)
    {
        if (c == null || string.IsNullOrEmpty(c.GermanName) && c.PortraitId.IsNone)
        {
            return;
        }

        sw.WriteLine($"{id.Id:D3} {id} ({c.EnglishName}, {c.GermanName}, {c.FrenchName})");
        sw.WriteLine($"    Type:{c.Type} Gender:{c.Gender} Races:{c.Race} Class:{c.PlayerClass} Age:{c.Age} Level:{c.Level}");
        sw.WriteLine($"    Languages:{c.Languages} Sprite:{c.SpriteId} Portrait:{c.PortraitId}");
        if (c.Inventory?.Slots != null)
        {
            sw.WriteLine($"    Inventory: (Gold:{c.Inventory.Gold.Amount / 10.0}, Rations:{c.Inventory.Rations.Amount})");
            sw.WriteLine($"             Head: {c.Inventory.Head}");
            sw.WriteLine($"             Neck: {c.Inventory.Neck}");
            sw.WriteLine($"            Chest: {c.Inventory.Chest}");
            sw.WriteLine($"            LHand: {c.Inventory.LeftHand}");
            sw.WriteLine($"            RHand: {c.Inventory.RightHand}");
            sw.WriteLine($"             Tail: {c.Inventory.Tail}");
            sw.WriteLine($"          LFinger: {c.Inventory.LeftFinger}");
            sw.WriteLine($"          RFinger: {c.Inventory.RightFinger}");
            sw.WriteLine($"             Feet: {c.Inventory.Feet}");
            sw.WriteLine("             Pack:");
            foreach (var item in c.Inventory.Slots.Where(x => x?.Item != null))
            {
                sw.WriteLine($"                 {item}");
            }
        }

        sw.WriteLine($"    {c.Attributes}");
        sw.WriteLine($"    {c.Skills}");
        sw.WriteLine($"    {c.Combat}");
        if (c.Magic.SpellStrengths.Any())
        {
            sw.WriteLine($"    Magic: SP{c.Magic.SpellPoints} Classes: {c.Magic.SpellClasses}");
            for (int i = 0; i < CharacterSheet.MaxSpellsPerSchool * CharacterSheet.SpellSchoolCount; i++)
            {
                var  spellId = new SpellId(AssetType.Spell, i + 1);
                bool known   = c.Magic.KnownSpells.Contains(spellId);
                c.Magic.SpellStrengths.TryGetValue(spellId, out var strength);
                if (known || strength > 0)
                {
                    sw.WriteLine($"        {spellId} {strength} ({(known ? "Learnt": "Unknown")})");
                }
            }
        }

        sw.WriteLine($"    WordSetId:{c.WordSetId}");

        var eventSet = assets.LoadEventSet(c.EventSetId);

        sw.WriteLine($"    Event Set {c.EventSetId}: {(eventSet == null ? "Not Found" : $"{eventSet.Chains.Count} chains")}");
Esempio n. 21
0
        public override int GetHashCode()
        {
            int prime  = 31;
            int result = 1;

            result = prime * result + CharacterId.BitShiftThenBitOr(prime);
            result = prime * result + Owner.GetHashCode().BitShiftThenBitOr(prime);
            result = prime * result + Level.BitShiftThenBitOr(prime);
            result = prime * result + _Inventory.ListToInt <MarketItem>().BitShiftThenBitOr(prime);
            result = prime * result + Name.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + Race.RaceToInt().BitShiftThenBitOr(prime);
            result = prime * result + Gender.GenderToInt().BitShiftThenBitOr(prime);
            return(result);
        }
Esempio n. 22
0
    /// <summary>
    /// Updates the character data of given name with parameters.
    /// </summary>
    /// <param name="name">Name.</param>
    /// <param name="experience">Experience.</param>
    /// <param name="curHealth">Current health.</param>
    /// <param name="curEnergy">Current energy.</param>
    public static void UpdateCharacterData(CharacterId name, int experience, int curHealth, int curEnergy)
    {
//        if (((int)name) < m_savedCharacterData.Length)
        CharacterSaveData character;

        if (GetCharacterSavedData(name, out character))
        {
            Debug.LogError(string.Format("Could not find character with name {0}", name.ToString()));
            return;
        }

        character.m_experience = experience;
        character.m_curHealth  = curHealth;
        character.m_curEnergy  = curEnergy;
    }
Esempio n. 23
0
 public static void TransferToProfile(CharacterId character)
 {
     ProfileController.CharacterToShow = character;
     JustTransferToProfile();
 }
Esempio n. 24
0
 private void OnPartyRemoved(CharacterId character)
 {
     RemoveCharacter();
 }
 public UserCharacter(string id, SaveData.Character character)
 {
     Id = EnumHelper.ParseOrDefault<CharacterId>(id);
     Data = CharacterDb._.Find(Id);
     SkillSet = character.SkillSet ?? CharacterBalance._.Find(Id).SkillSetDefault.Clone();
 }
 private void OnRemove(PartyIdx idx, CharacterId id)
 {
     this[idx].RemoveCharacter();
 }
 public static UserCharacter Find(CharacterId id)
 {
     UserCharacter ret;
     _data.TryGet(id, out ret);
     return ret;
 }
Esempio n. 28
0
 public PartyMember(CharacterId id)
 {
     Character = id;
 }