コード例 #1
0
        public static V_Object CreateSkeletonPresetAnim_DebugDash(Vector3 position, Color color, float frameRate = 1f)
        {
            Material material = new Material(GetWhitePixelMaterial());

            material.color = color;
            V_Object vObject = V_Object.CreateSkeletonPresetAnim(position, material, UnitAnim.GetUnitAnim("EffectDash"), frameRate, new Vector3(0, 1, 0), new Vector3(3f, 1f, 1f), 100);

            return(vObject);
        }
コード例 #2
0
 public void CinematicLookDown(float timer)
 {
     state = State.Busy;
     rigidbody3D.velocity = Vector3.zero;
     //characterBase.GetUnitAnimation().PlayAnimForced(UnitAnimType.GetUnitAnimType(""), new Vector3(0, -1), 1f, null, null, null);
     characterBase.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_Victory"), 1f, null, null, null);
     FunctionTimer.Create(() => {
         state = State.Normal;
     }, timer);
 }
コード例 #3
0
 public void PlayJumpAnim(Vector3 moveDir)
 {
     if (moveDir.x >= 0)
     {
         unitAnimation.PlayAnim(UnitAnim.GetUnitAnim("dBareHands_JumpRight"));
     }
     else
     {
         unitAnimation.PlayAnim(UnitAnim.GetUnitAnim("dBareHands_JumpLeft"));
     }
 }
コード例 #4
0
    public void Damage(CharacterBattle attacker, int damageAmount)
    {
        //damageAmount = 1; Debug.Log("##### No Damage");
        Vector3 bloodDir = (GetPosition() - attacker.GetPosition()).normalized;

        Blood_Handler.SpawnBlood(GetPosition(), bloodDir);

        SoundManager.PlaySound(SoundManager.Sound.CharacterDamaged);
        DamagePopup.Create(GetPosition(), damageAmount, false);
        healthSystem.Damage(damageAmount);
        DamageFlash();
        playerBase.GetUnitAnimation().PlayAnimForced(hitUnitAnimType, GetTargetDir(), 1f, (UnitAnim unitAnim) => {
            PlayIdleAnim();
        }, null, null);

        if (IsDead())
        {
            if (!IsPlayerTeam())
            {
                // Enemy
                if (characterType != Character.Type.EvilMonster && characterType != Character.Type.EvilMonster_2 && characterType != Character.Type.EvilMonster_3)
                {
                    // Don't spawn Flying Body for Evil Monster
                    FlyingBody.Create(GameAssets.i.pfEnemyFlyingBody, GetPosition(), bloodDir);
                    SoundManager.PlaySound(SoundManager.Sound.CharacterDead);
                }
                gameObject.SetActive(false);
            }
            else
            {
                // Player Team
                stats.special = 0;
                SoundManager.PlaySound(SoundManager.Sound.OooohNooo);
            }
            playerBase.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("LyingUp"), 1f, null);
            healthWorldBar.Hide();
            transform.localScale = new Vector3(-1, 1, 1);
            //gameObject.SetActive(false);
            //Destroy(gameObject);
        }
        else
        {
            // Knockback

            /*
             * transform.position += bloodDir * 5f;
             * if (hitUnitAnim != null) {
             *  state = State.Busy;
             *  enemyBase.PlayHitAnimation(bloodDir * (Vector2.one * -1f), SetStateNormal);
             * }
             */
        }
    }
コード例 #5
0
 static UnitAnimEnum()
 {
     V_Animation.Init();
     FieldInfo[] fieldInfoArr = typeof(UnitAnimEnum).GetFields(BindingFlags.Static | BindingFlags.Public);
     foreach (FieldInfo fieldInfo in fieldInfoArr)
     {
         if (fieldInfo != null)
         {
             fieldInfo.SetValue(null, UnitAnim.GetUnitAnim(fieldInfo.Name));
         }
     }
 }
コード例 #6
0
    public void SleezerTripUp()
    {
        // Get tripped up by Sleezer
        state = State.Tripped;
        playerBase.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("LyingUp"), 1f, null);

        /*
         * FunctionTimer.Create(() => {
         *  ChatBubble.Create(transform, new Vector3(3.5f, 5), "Oh Sleezer! You're so silly!");
         * }, 5f);
         */
        FunctionTimer.Create(() => {
            state = State.Normal;
            playerBase.PlayIdleAnim();
        }, 5f);
    }
コード例 #7
0
    public void SetWeaponType(WeaponType weaponType)
    {
        switch (weaponType)
        {
        default:
        case WeaponType.Rifle:
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("dMarine_AimWeaponRight"), UnitAnim.GetUnitAnim("dMarine_AimWeaponLeft"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponRight"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponLeft"));
            break;

        case WeaponType.Pistol:
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_PistolRight"), UnitAnim.GetUnitAnim("Aim_PistolLeft"), UnitAnim.GetUnitAnim("Aim_PistolShootRight"), UnitAnim.GetUnitAnim("Aim_PistolShootLeft"));
            break;

        case WeaponType.Shotgun:
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_ShotgunRight"), UnitAnim.GetUnitAnim("Aim_ShotgunLeft"), UnitAnim.GetUnitAnim("Aim_ShotgunShootRight"), UnitAnim.GetUnitAnim("Aim_ShotgunShootLeft"));
            break;
        }
    }
コード例 #8
0
    public void PlayAnimationWoodChop(Vector3 lookAtPosition, Action onAnimationCompleted)
    {
        state = State.Animating;
        string anim = "WoodDownRight";

        if (lookAtPosition.x > transform.position.x)
        {
            anim = "WoodDownRight";
        }
        else
        {
            anim = "WoodDownLeft";
        }
        animatedWalker.unitAnimation.PlayAnimForced(UnitAnim.GetUnitAnim(anim), 1f, () => {
            state = State.Idle;
            if (onAnimationCompleted != null)
            {
                onAnimationCompleted();
            }
        });
    }
コード例 #9
0
    private void Start()
    {
        Transform bodyTransform = transform.Find("Body");

        unitSkeleton  = new V_UnitSkeleton(1f, bodyTransform.TransformPoint, (Mesh mesh) => bodyTransform.GetComponent <MeshFilter>().mesh = mesh);
        unitAnimation = new V_UnitAnimation(unitSkeleton);

        idleUnitAnim   = GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Idle;
        walkUnitAnim   = GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Walk;
        hitUnitAnim    = null;
        attackUnitAnim = null;

        idleUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Idle");
        walkUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Walk");
        hitUnitAnim    = UnitAnimType.GetUnitAnimType("dBareHands_Hit");
        attackUnitAnim = UnitAnimType.GetUnitAnimType("dBareHands_PunchQuickAttack");

        animatedWalker = new AnimatedWalker(unitAnimation, idleUnitAnim, walkUnitAnim, 1f, .75f);

        state = State.Normal;

        FunctionTimer.Create(() => unitAnimation.PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_JumpRight"), 1f, null), 2f);
    }
コード例 #10
0
    public void SetWeaponType(WeaponType weaponType)
    {
        switch (weaponType)
        {
        default:
        case WeaponType.Rifle:
            UnitAnim rifleReloadRightUnitAnim = UnitAnim.GetUnitAnim("dMarine_ReloadRifleRight").CloneDeep();
            rifleReloadRightUnitAnim.SetFrameRateMod(1.4f);
            UnitAnim rifleReloadLeftUnitAnim = UnitAnim.GetUnitAnim("dMarine_ReloadRifleLeft").CloneDeep();
            rifleReloadLeftUnitAnim.SetFrameRateMod(1.4f);

            unitSkeletonCompositeWeaponReload.SetAnims(rifleReloadRightUnitAnim, rifleReloadLeftUnitAnim);
            //unitSkeletonCompositeWeaponReload.SetAnims(UnitAnim.GetUnitAnim("dMarine_ReloadRifleRight"), UnitAnim.GetUnitAnim("dMarine_ReloadRifleLeft"));
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("dMarine_AimWeaponRight"), UnitAnim.GetUnitAnim("dMarine_AimWeaponLeft"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponRight"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponLeft"));
            break;

        case WeaponType.Pistol:
            UnitAnim pistolReloadRightUnitAnim = UnitAnim.GetUnitAnim("Aim_PistolReloadRight").CloneDeep();
            pistolReloadRightUnitAnim.SetFrameRateMod(1.4f);
            UnitAnim pistolReloadLeftUnitAnim = UnitAnim.GetUnitAnim("Aim_PistolReloadLeft").CloneDeep();
            pistolReloadLeftUnitAnim.SetFrameRateMod(1.4f);

            unitSkeletonCompositeWeaponReload.SetAnims(pistolReloadRightUnitAnim, pistolReloadLeftUnitAnim);
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_PistolRight"), UnitAnim.GetUnitAnim("Aim_PistolLeft"), UnitAnim.GetUnitAnim("Aim_PistolShootRight"), UnitAnim.GetUnitAnim("Aim_PistolShootLeft"));
            break;

        case WeaponType.Shotgun:
            unitSkeletonCompositeWeaponReload.SetAnims(UnitAnim.GetUnitAnim("Aim_ShotgunReloadRight"), UnitAnim.GetUnitAnim("Aim_ShotgunReloadLeft"));
            unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_ShotgunRight"), UnitAnim.GetUnitAnim("Aim_ShotgunLeft"), UnitAnim.GetUnitAnim("Aim_ShotgunShootRight"), UnitAnim.GetUnitAnim("Aim_ShotgunShootLeft"));
            break;
        }

        canShoot    = true;
        isReloading = false;
        unitSkeletonCompositeWeaponReload.SetInactive();
        unitSkeletonCompositeWeapon.SetActive();
    }
コード例 #11
0
        public static V_Object CreateSkeletonPresetAnim_DebugDash(Vector3 position)
        {
            V_Object vObject = V_Object.CreateSkeletonPresetAnim(position, GetWhitePixelMaterial(), UnitAnim.GetUnitAnim("EffectDash"), 1f, new Vector3(0, 1, 0), new Vector3(3f, 1f, 1f), 100);

            return(vObject);
        }
コード例 #12
0
    public void Setup(Character.Type characterType, BattleHandler.LanePosition lanePosition, Vector3 startingPosition, bool isPlayerTeam, Character.Stats stats)
    {
        this.characterType    = characterType;
        this.lanePosition     = lanePosition;
        this.startingPosition = startingPosition;
        this.isPlayerTeam     = isPlayerTeam;
        this.stats            = stats;

        hitUnitAnimType    = GameAssets.UnitAnimTypeEnum.dBareHands_Hit;
        slideLeftUnitAnim  = UnitAnim.GetUnitAnim("dBareHands_SlideLeft");
        slideRightUnitAnim = UnitAnim.GetUnitAnim("dBareHands_SlideRight");

        Vector3 healthWorldBarLocalPosition = new Vector3(0, 10);

        switch (characterType)
        {
        case Character.Type.Player:
            material.mainTexture = GameAssets.i.t_Player;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Idle, GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Walk, 1f, 1f);
            attackUnitAnimType = GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Sword;

            if (GameData.GetCharacter(Character.Type.Player).hasFtnDewArmor)
            {
                Texture2D newSpritesheetTexture = new Texture2D(material.mainTexture.width, material.mainTexture.height, TextureFormat.ARGB32, true);
                newSpritesheetTexture.SetPixels((material.mainTexture as Texture2D).GetPixels());
                Color[] ftnDewArmorPixels = GameAssets.i.t_FtnDewArmor.GetPixels(0, 0, 512, 128);
                newSpritesheetTexture.SetPixels(0, 256, 512, 128, ftnDewArmorPixels);
                newSpritesheetTexture.Apply();
                material.mainTexture = newSpritesheetTexture;
            }

            if (GameData.GetCharacter(Character.Type.Player).hasSwordThousandTruths)
            {
                Texture2D newSpritesheetTexture = new Texture2D(material.mainTexture.width, material.mainTexture.height, TextureFormat.ARGB32, true);
                newSpritesheetTexture.SetPixels((material.mainTexture as Texture2D).GetPixels());
                Color[] swordThousandTruthsPixels = GameAssets.i.t_SwordThousandTruths.GetPixels(0, 0, 128, 128);
                newSpritesheetTexture.SetPixels(0, 128, 128, 128, swordThousandTruthsPixels);
                newSpritesheetTexture.Apply();
                material.mainTexture = newSpritesheetTexture;
            }
            break;

        case Character.Type.Tank:
            material.mainTexture = GameAssets.i.t_Tank;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dSwordShield_Idle, GameAssets.UnitAnimTypeEnum.dSwordShield_Walk, 1f, 1f);
            attackUnitAnimType   = GameAssets.UnitAnimTypeEnum.dSwordShield_Attack;
            transform.localScale = Vector3.one * 1.2f;
            break;

        case Character.Type.Healer:
            material.mainTexture = GameAssets.i.t_Healer;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dDualDagger_Idle, GameAssets.UnitAnimTypeEnum.dDualDagger_Walk, 1f, 1f);
            attackUnitAnimType   = GameAssets.UnitAnimTypeEnum.dDualDagger_Attack;
            transform.localScale = Vector3.one * 1.0f;
            break;

        case Character.Type.EvilMonster:
        case Character.Type.EvilMonster_2:
        case Character.Type.EvilMonster_3:
            material.mainTexture = GameAssets.i.t_EvilMonster;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dBareHands_Idle, GameAssets.UnitAnimTypeEnum.dBareHands_Walk, 1f, 1f);
            attackUnitAnimType            = GameAssets.UnitAnimTypeEnum.dBareHands_Punch;
            transform.localScale          = Vector3.one * 1.8f;
            healthWorldBarLocalPosition.y = 9.5f;
            break;

        case Character.Type.Enemy_MinionOrange:
            material.mainTexture = GameAssets.i.t_EnemyMinionOrange;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dMinion_Idle, GameAssets.UnitAnimTypeEnum.dMinion_Walk, 1f, 1f);
            attackUnitAnimType = GameAssets.UnitAnimTypeEnum.dMinion_Attack;
            break;

        case Character.Type.Enemy_MinionRed:
            material.mainTexture = GameAssets.i.t_EnemyMinionRed;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dMinion_Idle, GameAssets.UnitAnimTypeEnum.dMinion_Walk, 1f, 1f);
            attackUnitAnimType = GameAssets.UnitAnimTypeEnum.dMinion_Attack;
            break;

        case Character.Type.Enemy_Ogre:
            material.mainTexture = GameAssets.i.t_Ogre;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dOgre_Idle, GameAssets.UnitAnimTypeEnum.dOgre_Walk, 1f, 1f);
            attackUnitAnimType            = GameAssets.UnitAnimTypeEnum.dOgre_Attack;
            hitUnitAnimType               = UnitAnimType.GetUnitAnimType("dOgre_Hit");
            slideLeftUnitAnim             = UnitAnim.GetUnitAnim("dOgre_SlideLeft");
            slideRightUnitAnim            = UnitAnim.GetUnitAnim("dOgre_SlideRight");
            healthWorldBarLocalPosition.y = 12;
            break;

        case Character.Type.Enemy_Zombie:
            material.mainTexture = GameAssets.i.t_Zombie;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dZombie_Idle, GameAssets.UnitAnimTypeEnum.dZombie_Walk, 1f, 1f);
            attackUnitAnimType = GameAssets.UnitAnimTypeEnum.dZombie_Attack;
            break;
        }
        transform.Find("Body").GetComponent <MeshRenderer>().material = material;

        healthSystem = new HealthSystem(stats.healthMax);
        healthSystem.SetHealthAmount(stats.health);
        healthWorldBar = new World_Bar(transform, healthWorldBarLocalPosition, new Vector3(12 * (stats.healthMax / 100f), 1.6f), Color.grey, Color.red, healthSystem.GetHealthPercent(), UnityEngine.Random.Range(1000, 2000), new World_Bar.Outline {
            color = Color.black, size = .6f
        });
        healthSystem.OnHealthChanged += HealthSystem_OnHealthChanged;
        healthSystem.OnDead          += HealthSystem_OnDead;

        PlayIdleAnim();
    }
コード例 #13
0
    public static void Play_LostToEvilMonster_2()
    {
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();

        List <World_Sprite> ropeWorldSpriteList = new List <World_Sprite>();

        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetPlayer().GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition(), Vector3.one * 1.2f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition(), Vector3.one * 0.7f, GameAssets.i.s_Rope, Color.white, 100));

        NPCOvermap randyOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));

        randyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_IdleUp"), 1f, null);
        Vector3 randyStartingPosition = randyOvermap.GetPosition();

        randyOvermap.overrideOvermapRunning = true;

        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.HideLeftText();
                dialogue.ShowRightCharacter(GameAssets.i.s_RandyPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Randy));
                dialogue.ShowRightText("Oh my, this is my lucky day");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Oh no, you again");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("What's wrong, not happy to see me?");
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("It seems we miraculously lost again"); },
            () => { dialogue.ShowLeftText("It's very annoying to get the Evil Monster almost near death and suddenly he wins"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Oh dear that is a real bother"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Yes it is, are you going to let us go?"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Huhuhu maybe"); },
            () => { dialogue.ShowRightText("My oh my, you are truly precious"); },
            () => { dialogue.ShowRightText("If you really want to defeat him you need the Sword of Thousand Truths"); },
            () => { dialogue.ShowRightText("And would you look at that, I have it right here!"); },
            () => { dialogue.ShowRightText("Have fun! Huhuhu!"); },
            () => {
                // Randy Disappears in Smoke
                // Drop Sword

                /*
                 * NPCOvermap npcOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));
                 * Transform objectTractorTransform = UnityEngine.Object.Instantiate(GameAssets.i.pfObjectTractor, npcOvermap.GetPosition(), Quaternion.identity);
                 * objectTractorTransform.GetComponent<TractorBehaviour>().Setup(OvermapHandler.GetInstance().GetPlayer(), 20f, 8f, () => {
                 *  GameData.GetCharacter(Character.Type.Player).hasSwordThousandTruths = true;
                 *  OvermapHandler.GetInstance().GetPlayer().RefreshTexture();
                 * });
                 *
                 * npcOvermap.Hide();
                 * UIBlack.Hide();
                 * dialogue.Hide();
                 * FunctionTimer.Create(() => {
                 *  UIBlack.Show();
                 *  dialogue.Show();
                 *  dialogue.PlayNextAction();
                 * }, 1f);
                 */


                Transform objectTractorTransform        = UnityEngine.Object.Instantiate(GameAssets.i.pfObjectTractor, randyOvermap.GetPosition(), Quaternion.identity);
                objectTractorTransform.localEulerAngles = new Vector3(0, 0, -45);
                objectTractorTransform.GetComponent <TractorBehaviour>().Setup(OvermapHandler.GetInstance().GetPlayer(), 20f, 8f, () => {
                    GameData.GetCharacter(Character.Type.Player).hasSwordThousandTruths = true;
                    OvermapHandler.GetInstance().GetPlayer().RefreshTexture();
                    SoundManager.PlaySound(SoundManager.Sound.Coin);
                });

                // Randy Disappears in Smoke
                UIBlack.Hide();
                dialogue.Hide();

                // Untie Player
                randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetPlayer().GetPosition() + new Vector3(0, -5));
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[0].DestroySelf();
                }, 1f);

                // Untie Healer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition() + new Vector3(+5, 0));
                }, 1f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[1].DestroySelf();
                }, 2f);

                // Untie Tank
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(-5, 0));
                }, 2f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[2].DestroySelf();
                }, 3f);

                // Untie Sleezer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition() + new Vector3(-5, 0));
                }, 3f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[3].DestroySelf();
                }, 4f);

                // Go to disappear
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(randyStartingPosition);
                }, 4f);
                FunctionTimer.Create(() => {
                    OvermapHandler.GetInstance().SpawnSmoke(randyOvermap.GetPosition(), .0f, Vector3.one);
                }, 5f);
                FunctionTimer.Create(() => {
                    randyOvermap.Hide();
                }, 5.5f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 6.5f);
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("He's very odd but somehow very helpful");
                dialogue.HideRightCharacter();
                dialogue.HideRightCharacterName();
            },
            () => { dialogue.ShowLeftText("Why would the Evil Monster keep him around?"); },
            () => { dialogue.ShowLeftText("Anyways who cares we have the Sword of a Thousand Truths!"); },
            () => {
                dialogue.ShowLeftText("Let's get him once and for all!");
            },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                GameData.state = GameData.State.MovingToEvilMonster_3;
                Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_3").position, Color.white, Color.white);
            },
        }, true);
    }
コード例 #14
0
    public static void Play_LostToEvilMonster_1()
    {
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();

        List <World_Sprite> ropeWorldSpriteList = new List <World_Sprite>();

        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetPlayer().GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition(), Vector3.one * 1.2f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition(), Vector3.one * 0.7f, GameAssets.i.s_Rope, Color.white, 100));

        NPCOvermap randyOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));

        randyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_IdleUp"), 1f, null);
        Vector3 randyStartingPosition = randyOvermap.GetPosition();

        randyOvermap.overrideOvermapRunning = true;

        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowLeftText("Oh come on, we had him! What happened?");
                dialogue.ShowRightCharacter(GameAssets.i.s_TankPortrait, true);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Seems he overpowered us somehow...");
            },
            () => {
                dialogue.ShowRightCharacter(GameAssets.i.s_RandyPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Randy));
                dialogue.ShowRightActiveTalkerHideLeft("Oh my, aren't you precious");
            },
            () => { dialogue.ShowRightText("You boys are quite fancy huhuhu"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Who are you? Are you here to torture us?"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Oh my, I could never torture such delicate specimens"); },
            () => { dialogue.ShowRightText("You are too pretty to be tied up"); },
            () => { dialogue.ShowRightText("Allow me to help you huhuhu"); },
            () => {
                // Randy Disappears in Smoke
                UIBlack.Hide();
                dialogue.Hide();

                // Untie Player
                randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetPlayer().GetPosition() + new Vector3(0, -5));
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[0].DestroySelf();
                }, 1f);

                // Untie Healer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition() + new Vector3(+5, 0));
                }, 1f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[1].DestroySelf();
                }, 2f);

                // Untie Tank
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(-5, 0));
                }, 2f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[2].DestroySelf();
                }, 3f);

                // Untie Sleezer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition() + new Vector3(-5, 0));
                }, 3f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[3].DestroySelf();
                }, 4f);

                // Go to disappear
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(randyStartingPosition);
                }, 4f);
                FunctionTimer.Create(() => {
                    OvermapHandler.GetInstance().SpawnSmoke(randyOvermap.GetPosition(), .0f, Vector3.one);
                }, 5f);
                FunctionTimer.Create(() => {
                    randyOvermap.Hide();
                }, 5.5f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 7.5f);
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Well that was weird...");
                dialogue.HideRightCharacterName();
                dialogue.HideRightCharacter();
            },
            () => {
                dialogue.ShowLeftText("But hey lets keep going! He's not getting away this time");
            },

            /*
             * () => {
             *  NPCOvermap npcOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));
             *  npcOvermap.SetTargetMovePosition();
             *  dialogue.Hide();
             *  UIBlack.Hide();
             *  OvermapHandler.StartOvermapRunning();
             * },*/
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                GameData.state = GameData.State.MovingToEvilMonster_2;
                Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_2").position, Color.white, Color.white);
            },
        }, true);
    }
コード例 #15
0
    public static void Play_Tavern()
    {
        Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("tavern").position);
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue  dialogue = Dialogue.GetInstance();
        Character tavernAmbushCharacter = GameData.GetCharacter(Character.Type.TavernAmbush);

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowLeftText("Greetings!");
                dialogue.HideRightCharacter();
                dialogue.HideRightText();
                dialogue.HideRightCharacterName();
            },
            () => { dialogue.ShowLeftText("May we have some refreshments?"); },
            () => {
                UIBlack.Hide();
                dialogue.Hide();

                Vector3 playerPosition = OvermapHandler.GetInstance().GetPlayer().GetPosition();
                OvermapHandler.GetInstance().GetPlayer().GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dSwordTwoHandedBack_IdleDown"), 1f, null);

                NPCOvermap enemyOvermap         = OvermapHandler.GetInstance().GetNPC(tavernAmbushCharacter);
                enemyOvermap.transform.position = playerPosition + new Vector3(0, -17f);
                enemyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap.GetPosition(), .3f, Vector3.one);

                NPCOvermap enemyOvermap_2         = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.TavernAmbush_2));
                enemyOvermap_2.transform.position = playerPosition + new Vector3(14f, -12f);
                enemyOvermap_2.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap_2.GetPosition(), .3f, Vector3.one);

                NPCOvermap enemyOvermap_3         = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.TavernAmbush_3));
                enemyOvermap_3.transform.position = playerPosition + new Vector3(-14, -12f);
                enemyOvermap_3.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap_3.GetPosition(), .3f, Vector3.one);

                enemyOvermap.gameObject.SetActive(false);
                enemyOvermap_2.gameObject.SetActive(false);
                enemyOvermap_3.gameObject.SetActive(false);
                FunctionTimer.Create(() => {
                    enemyOvermap.gameObject.SetActive(true);
                    enemyOvermap_2.gameObject.SetActive(true);
                    enemyOvermap_3.gameObject.SetActive(true);
                }, .45f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 1.2f);
            },
            () => {
                dialogue.HideLeftText();
                dialogue.FadeLeftCharacter();
                dialogue.ShowRightCharacter(GameAssets.i.s_EnemyMinionRedPortrait, false);
                dialogue.ShowRightText("That's the one! Get him!");
            },
            () => {
                GameData.GetCharacter(Character.Type.TavernAmbush_2).isDead = true;
                GameData.GetCharacter(Character.Type.TavernAmbush_3).isDead = true;
                GameData.state = GameData.State.FightingTavernAmbush;
                BattleHandler.LoadEnemyEncounter(tavernAmbushCharacter, tavernAmbushCharacter.enemyEncounter);
            },
        }, true);
    }
コード例 #16
0
 private void Start()
 {
     GetComponent <Player_Base>().GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim(animName), 1f, null);
 }
コード例 #17
0
    private void Start()
    {
        /*
         * Transform bodyTransform = transform.Find("Body");
         * unitSkeleton = new V_UnitSkeleton(1f, bodyTransform.TransformPoint, (Mesh mesh) => bodyTransform.GetComponent<MeshFilter>().mesh = mesh);
         * unitAnimation = new V_UnitAnimation(unitSkeleton);
         */

        vObject         = CreateBasicUnit(transform, GetPosition(), 30f, null);
        unitAnimation   = vObject.GetLogic <V_UnitAnimation>();
        unitSkeleton    = vObject.GetLogic <V_UnitSkeleton>();
        objectTransform = vObject.GetLogic <V_IObjectTransform>();

        UnitAnimType idleUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Idle");
        UnitAnimType walkUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Walk");
        UnitAnimType hitUnitAnim    = UnitAnimType.GetUnitAnimType("dBareHands_Hit");
        UnitAnimType attackUnitAnim = UnitAnimType.GetUnitAnimType("dBareHands_PunchQuickAttack");

        canShoot = true;

        unitSkeletonCompositeWeapon = new V_UnitSkeleton_Composite_Weapon(vObject, unitSkeleton, UnitAnim.GetUnitAnim("Aim_PistolRight"), UnitAnim.GetUnitAnim("Aim_PistolLeft"), UnitAnim.GetUnitAnim("Aim_PistolShootRight"), UnitAnim.GetUnitAnim("Aim_PistolShootLeft"));
        vObject.AddRelatedObject(unitSkeletonCompositeWeapon);
        unitSkeletonCompositeWeapon.SetActive();

        unitSkeletonCompositeWalker_BodyHead = new V_UnitSkeleton_Composite_Walker(vObject, unitSkeleton, GameAssets.UnitAnimTypeEnum.dMarine_Walk, GameAssets.UnitAnimTypeEnum.dMarine_Idle, new[] { "Body", "Head" });
        vObject.AddRelatedObject(unitSkeletonCompositeWalker_BodyHead);

        unitSkeletonCompositeWalker_Feet = new V_UnitSkeleton_Composite_Walker(vObject, unitSkeleton, GameAssets.UnitAnimTypeEnum.dMarine_Walk, GameAssets.UnitAnimTypeEnum.dMarine_Idle, new[] { "FootL", "FootR" });
        vObject.AddRelatedObject(unitSkeletonCompositeWalker_Feet);
    }
コード例 #18
0
 public void PlayWinAnimation()
 {
     unitAnimation.PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_Victory"), 1f, null);
 }
コード例 #19
0
    private void Awake()
    {
        vObject         = CreateBasicUnit(transform, GetPosition(), 30f, null);
        unitAnimation   = vObject.GetLogic <V_UnitAnimation>();
        unitSkeleton    = vObject.GetLogic <V_UnitSkeleton>();
        objectTransform = vObject.GetLogic <V_IObjectTransform>();

        UnitAnimType idleUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Idle");
        UnitAnimType walkUnitAnim   = UnitAnimType.GetUnitAnimType("dBareHands_Walk");
        UnitAnimType hitUnitAnim    = UnitAnimType.GetUnitAnimType("dBareHands_Hit");
        UnitAnimType attackUnitAnim = UnitAnimType.GetUnitAnimType("dBareHands_PunchQuickAttack");

        canShoot = true;

        //unitSkeletonCompositeWeapon = new V_UnitSkeleton_Composite_Weapon(vObject, unitSkeleton, UnitAnim.GetUnitAnim("Aim_PistolRight"), UnitAnim.GetUnitAnim("Aim_PistolLeft"), UnitAnim.GetUnitAnim("Aim_PistolShootRight"), UnitAnim.GetUnitAnim("Aim_PistolShootLeft"));
        unitSkeletonCompositeWeapon = new V_UnitSkeleton_Composite_Weapon(vObject, unitSkeleton, UnitAnim.GetUnitAnim("dMarine_AimWeaponRight"), UnitAnim.GetUnitAnim("dMarine_AimWeaponLeft"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponRight"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponLeft"));
        //unitSkeletonCompositeWeapon = new V_UnitSkeleton_Composite_Weapon(vObject, unitSkeleton, UnitAnim.GetUnitAnim("Aim_ShotgunRight"), UnitAnim.GetUnitAnim("Aim_ShotgunLeft"), UnitAnim.GetUnitAnim("Aim_ShotgunShootRight"), UnitAnim.GetUnitAnim("Aim_ShotgunShootLeft"));
        vObject.AddRelatedObject(unitSkeletonCompositeWeapon);
        unitSkeletonCompositeWeapon.SetActive();

        unitSkeletonCompositeWalker_BodyHead = new V_UnitSkeleton_Composite_Walker(vObject, unitSkeleton, GameAssets.UnitAnimTypeEnum.dMarine_Walk, GameAssets.UnitAnimTypeEnum.dMarine_Idle, new[] { "Body", "Head" });
        vObject.AddRelatedObject(unitSkeletonCompositeWalker_BodyHead);

        unitSkeletonCompositeWalker_Feet = new V_UnitSkeleton_Composite_Walker(vObject, unitSkeleton, GameAssets.UnitAnimTypeEnum.dMarine_Walk, GameAssets.UnitAnimTypeEnum.dMarine_Idle, new[] { "FootL", "FootR" });
        vObject.AddRelatedObject(unitSkeletonCompositeWalker_Feet);
    }
コード例 #20
0
 public void PlayAnimSlideLeft()
 {
     unitAnimation.PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_SlideLeft"), 1f, null);
 }
コード例 #21
0
 public void PlayAnimLyingUp()
 {
     unitAnimation.PlayAnimForced(UnitAnim.GetUnitAnim("LyingUp"), 1f, null);
 }
コード例 #22
0
        public static V_Object CreateSkeletonPresetAnim_DebugDash(Vector3 position, Vector3 rotationDir, Vector3 localScale)
        {
            V_Object vObject = V_Object.CreateSkeletonPresetAnim(position, GetWhitePixelMaterial(), UnitAnim.GetUnitAnim("EffectDash"), 1f, rotationDir, localScale, 100);

            return(vObject);
        }
コード例 #23
0
    public void Update()
    {
        switch (state)
        {
        case State.WaitingForPlayer:
            // Player Turn

            if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W))
            {
                // Select Target Up
                SetSelectedTargetCharacterBattle(
                    GetNextCharacterBattle(selectedTargetCharacterBattle.GetLanePosition(), true, false));
            }

            if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S))
            {
                // Select Target Down
                SetSelectedTargetCharacterBattle(
                    GetNextCharacterBattle(selectedTargetCharacterBattle.GetLanePosition(), false, false));
            }

            if (Input.GetKeyDown(KeyCode.Space))
            {
                // Attack
                state = State.Busy;
                SetCamera(selectedTargetCharacterBattle.GetPosition() + new Vector3(-5f, 0), 30f);
                activeCharacterBattle.AttackTarget(selectedTargetCharacterBattle.GetPosition(), () =>
                {
                    SoundManager.PlaySound(SoundManager.Sound.CharacterHit);
                    int damageBase = activeCharacterBattle.GetAttack();
                    int damageMin  = (int)(damageBase * 0.8f);
                    int damageMax  = (int)(damageBase * 1.2f);
                    selectedTargetCharacterBattle.Damage(activeCharacterBattle,
                                                         UnityEngine.Random.Range(damageMin, damageMax));
                    UtilsClass.ShakeCamera(.75f, .1f);
                    if (selectedTargetCharacterBattle.IsDead())
                    {
                        TestEvilMonsterKilled();
                    }
                }, () =>
                {
                    ResetCamera();
                    activeCharacterBattle.SlideBack(() => FunctionTimer.Create(ChooseNextActiveCharacter, .2f));
                });
            }

            if (Input.GetKeyDown(KeyCode.R))
            {
                // Special
                if (activeCharacterBattle.TrySpendSpecial())
                {
                    // Spend Special
                    switch (activeCharacterBattle.GetCharacterType())
                    {
                    default:
                    case Character.Type.Player:
                        state = State.Busy;
                        SetCamera(selectedTargetCharacterBattle.GetPosition() + new Vector3(-5f, 0), 30f);
                        Vector3 slideToPosition =
                            selectedTargetCharacterBattle.GetPosition() + new Vector3(-8f, 0);
                        activeCharacterBattle.SlideToPosition(slideToPosition, () =>
                        {
                            activeCharacterBattle.PlayAnim(
                                UnitAnim.GetUnitAnim("dSwordShield_SpartanKickRight"), (UnitAnim u) =>
                            {
                                ResetCamera();
                                activeCharacterBattle.SlideBack(() =>
                                                                FunctionTimer.Create(ChooseNextActiveCharacter, .2f));
                            }, (string trigger) =>
                            {
                                // Massive Single Enemy Damage
                                SoundManager.PlaySound(SoundManager.Sound.CharacterHit);
                                UtilsClass.ShakeCamera(2f, .15f);
                                int damageAmount = 100;
                                selectedTargetCharacterBattle.Damage(activeCharacterBattle, damageAmount);
                                if (selectedTargetCharacterBattle.IsDead())
                                {
                                    TestEvilMonsterKilled();
                                }
                            });
                        });
                        break;

                    case Character.Type.Tank:
                        state = State.Busy;
                        activeCharacterBattle.SlideToPosition(
                            GetPosition(LanePosition.Middle, false) + new Vector3(-15, 0), () =>
                        {
                            activeCharacterBattle.PlayAnim(UnitAnim.GetUnitAnim("dDagger_GroundPound"),
                                                           (UnitAnim u) =>
                            {
                                activeCharacterBattle.SlideBack(() =>
                                                                FunctionTimer.Create(ChooseNextActiveCharacter, .2f));
                            }, (string trigger) =>
                            {
                                // Damage All Enemies
                                SoundManager.PlaySound(SoundManager.Sound.GroundPound);
                                UtilsClass.ShakeCamera(2f, .15f);
                                int damageAmount = 30;
                                List <CharacterBattle> characterBattleList =
                                    GetAliveTeamCharacterBattleList(false);
                                foreach (CharacterBattle characterBattle in characterBattleList)
                                {
                                    characterBattle.Damage(activeCharacterBattle, damageAmount);
                                }

                                if (selectedTargetCharacterBattle.IsDead())
                                {
                                    TestEvilMonsterKilled();
                                }
                            });
                        });
                        break;

                    case Character.Type.Healer:
                        state = State.Busy;
                        SetCamera(activeCharacterBattle.GetPosition(), 30f);
                        activeCharacterBattle.PlayAnim(UnitAnim.GetUnitAnim("dBareHands_Victory"),
                                                       (UnitAnim u) =>
                        {
                            activeCharacterBattle.PlayIdleAnim();
                            ResetCamera();
                            FunctionTimer.Create(ChooseNextActiveCharacter, .2f);
                        }, (string trigger) => { });

                        FunctionTimer.Create(() =>
                        {
                            // Heal all
                            SoundManager.PlaySound(SoundManager.Sound.Heal);
                            List <CharacterBattle> characterBattleList = GetAliveTeamCharacterBattleList(true);
                            foreach (CharacterBattle characterBattle in characterBattleList)
                            {
                                characterBattle.Heal(50);
                            }
                        }, 1.2f);
                        break;
                    }
                }
            }

            if (Input.GetKeyDown(KeyCode.T))
            {
                // Heal
                if (GameData.TrySpendHealthPotion())
                {
                    state = State.Busy;
                    activeCharacterBattle.Heal(100);
                    FunctionTimer.Create(ChooseNextActiveCharacter, .2f);
                }
            }

            break;

        case State.Busy:
            break;
        }
    }