Ejemplo n.º 1
0
        public static void HandleDictionaries(CustomCharacterData data)
        {
            string keyBase = data.nameShort.ToUpper();

            StringHandler.AddStringDefinition("#PLAYER_NAME_" + keyBase, data.name); //TODO override the get methods instead of overwriting!
            StringHandler.AddStringDefinition("#PLAYER_NICK_" + keyBase, data.nickname);

            StringHandler.AddDFStringDefinition("#CHAR_" + keyBase, data.name);
            StringHandler.AddDFStringDefinition("#CHAR_" + keyBase + "_SHORT", data.nameShort);
        }
Ejemplo n.º 2
0
        public static void CustomizeCharacter(PlayerController player, CustomCharacterData data, bool paradoxUsesSprites)
        {
            HandleStrings(player, data);

            ToolsCharApi.StartTimer("    Sprite Handling");
            SpriteHandler.HandleSprites(player, data);
            ToolsCharApi.StopTimerAndReport("    Sprite Handling");

            if (data.loadout != null)
            {
                HandleLoadout(player, data.loadout, data.altGun);
            }

            if (data.stats != null)
            {
                HandleStats(player, data.stats);
            }

            player.healthHaver.ForceSetCurrentHealth(data.health);
            player.healthHaver.Armor = (int)data.armor;


            player.characterIdentity = (PlayableCharacters)data.identity;

            //player.OverridePlayerSwitchState = "Ninja";
            //AkSoundEngine.switch

            //AkSoundEngine.SetSwitch("CHR_Player", (player.OverridePlayerSwitchState == null) ? data.nameShort : player.OverridePlayerSwitchState, player.gameObject);


            //AkSoundEngine.GetSwitch("CHR_Player", player.gameObject, out idk);



            //BotsModule.Log((player.OverridePlayerSwitchState == null) ? data.nameShort : player.OverridePlayerSwitchState);



            //BotsModule.Strings.Core.Set("#PLAYER_NICK_LOST", "Dead Thing");
            //BotsModule.Strings.Core.Set("#PLAYER_NAME_LOST", "Lost");

            StringHandler.AddStringDefinition("#PLAYER_NAME_" + player.characterIdentity.ToString().ToUpperInvariant(), data.name);
            StringHandler.AddStringDefinition("#PLAYER_NICK_" + player.characterIdentity.ToString().ToUpperInvariant(), data.nickname);

            StringHandler.AddDFStringDefinition("#CHAR_" + data.nameShort.ToString().ToUpper(), data.name);
            StringHandler.AddDFStringDefinition("#CHAR_" + data.nameShort.ToString().ToUpper() + "_SHORT", data.nameShort);

            //BotsModule.Log("Player is: " + data.nameShort.ToString(), BotsModule.LOST_COLOR);
            //BotsModule.Log("#CHAR_" + data.nameShort.ToUpper(), BotsModule.LOST_COLOR);

            /*if (!hasClearedEeveeAnims)
             * {
             *  var eevee = (GameObject)ResourceCache.Acquire("PlayerEevee");
             *  if (eevee != null)
             *  {
             *      eevee.GetComponent<CharacterAnimationRandomizer>().AnimationLibraries.Clear();
             *  }
             *  hasClearedEeveeAnims = true;
             * }*/

            if (paradoxUsesSprites)
            {
                var eevee = (GameObject)ResourceCache.Acquire("PlayerEevee");
                if (player.spriteAnimator.Library != null && eevee != null)
                {
                    eevee.GetComponent <CharacterAnimationRandomizer>().AddOverrideAnimLibrary(player.spriteAnimator.Library);
                    //BotsModule.Log("player.spriteAnimator.Library added");
                }
                if (player.AlternateCostumeLibrary != null && eevee != null)
                {
                    eevee.GetComponent <CharacterAnimationRandomizer>().AddOverrideAnimLibrary(player.AlternateCostumeLibrary);
                    //BotsModule.Log("AlternateCostumeLibrary added");
                }
            }



            //GameManager.Instance.PrimaryPlayer.GetComponent<CharacterAnimationRandomizer>().AddOverrideAnimLibrary(player.spriteAnimator.Library);
        }