Esempio n. 1
0
    private void Awake()
    {
        animator    = GetComponent <Animator>();
        physicsBody = GetComponent <Rigidbody2D>();

        skillManager = new SkillManager(this);
        skillManager.AddSkill("Flap");
        skillManager.AddSkill("Brake");

        speed = 2f;
    }
Esempio n. 2
0
    public IEnumerator Start()
    {
        Responsible.JobFinished   = false;
        Responsible.TargetInRange = false;

        if (Target)
        {
            Responsible.Target = Target.gameObject;
        }

        Responsible.StartCoroutine(Coroutine);

        if (!Responsible.Inventory.InInventory(Target.gameObject))
        {
            yield return(new WaitUntil(() => Responsible.TargetInRange));
        }

        if (Target == null || Target.InUse <= 0 || !Target.Methods.Contains(Method))
        {
            Debug.Log("Target is already in use!");
            Stop(true);
            yield break;
        }

        _started = true;
        Debug.Log("Reached to the target now I'm gonna start doing my job!");
        Target.InUse--;
        SkillManager.AddSkill(Responsible, SkillFactory.GetSkill(SkillType));
        EffectManager.Apply(Responsible, Effects);
    }
Esempio n. 3
0
 void Start()
 {
     SkillIMG = Resources.Load <Sprite>("Textures/Red");
     manager  = GetComponent <SkillManager>();
     key      = manager.AddSkill(AbilityIMG);
     rend     = GetComponent <Renderer>();
     origin   = rend.material.color;
     Delay    = Cooldown;
 }
Esempio n. 4
0
    void Update()
    {
        //退出游戏键
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            //SoundManager.instance.PlaySound("Combat02");
            //TravelManager.instance.EnterTravelMode();
            //LocalizationMgr.instance.ChangeToLanguage(Language.English);

            Time.timeScale = 2f;
        }
        if (Input.GetKeyDown(KeyCode.H))
        {
            SoundManager.instance.StopCategory(SoundCategory.Music);
            //LocalizationMgr.instance.ChangeToLanguage(Language.Chinese_Simplified);
        }
        if (Input.GetKeyDown(KeyCode.V))
        {
            //SoundManager.instance.PlaySound("PickUp");
            //SkillManager.AddSkill(testHeroes[0], "Magic_Air", 3);
            //MagicBookMgr.instance.SetMagics(testHeroes[0]);
            //MagicBookMgr.instance.ShowMagics(MagicSchool.All, MagicType.Battle);
            BattleResultMgr.instance.ShowResultUI(0);
        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            //SoundManager.instance.StopPlay("PickUp");
            //MagicBookMgr.instance.ShowMagics(MagicSchool.All, MagicType.All, 1);

            //MagicBookMgr.instance.Show();
            //BattleResultMgr.instance.ShowResultUI(1);
            //Resources.LoadAll<Sprite>("Textures");
        }
        if (Input.GetKeyDown(KeyCode.N))
        {
            Hero hero = GameManager.instance.players[0].heroes[0];

            SkillManager.AddSkill(hero, "Sorcery", 1);
            SkillManager.AddSkill(hero, "Wisdom", 2);
            SkillManager.AddSkill(hero, "Magic_Air", 2);
            SkillManager.AddSkill(hero, "Magic_Fire", 2);
            SkillManager.AddSkill(hero, "Magic_Water", 2);
            SkillManager.AddSkill(hero, "Magic_Earth", 2);

            //SkillManager.AddSkill(testHeroes[0], "Magic_Earth", 3);
            //MagicManager.instance.CastMagic(testHeroes[0], testHeroes[0].magics[1]);
        }
        if (Input.GetKeyDown(KeyCode.M))
        {
            SoundManager.instance.PlaySound("Combat02");
        }
    }
Esempio n. 5
0
    void Start()
    {
        //给测试英雄加上所有魔法
        MagicManager.AddAllMagic(heroes[0]);

        //AdvantureObjectMgr.CreateAdvantureObject("Chest", new Vector2Int(23, 19));
        //AdvantureObjectMgr.CreateAdvantureObject("Leorics", new Vector2Int(19, 17));
        //AdvantureObjectMgr.CreateAdvantureObject("Chest", new Vector2Int(23, 14));
        //AdvantureObjectMgr.CreateAdvantureObject("Gold", new Vector2Int(19, 14));
        //AdvantureObjectMgr.CreateAdvantureObject("Gold", new Vector2Int(17, 14));
        //AdvantureObjectMgr.CreateAdvantureObject("Gold", new Vector2Int(15, 14));

        SkillManager.AddSkill(heroes[0], "Magic_Air", 2);
        SkillManager.AddSkill(heroes[0], "Magic_Fire", 2);
        SkillManager.AddSkill(heroes[0], "Magic_Earth", 2);
        SkillManager.AddSkill(heroes[0], "Magic_Water", 2);

        StartCoroutine(DelayStart());
    }
Esempio n. 6
0
    private void Start()
    {
        AliveGameObject = transform.Find("Alive Player").gameObject;

        AnimationToStateMachine = AliveGameObject.GetComponent <PlayerAnimationToStateMachine>();
        MyAnmator          = AliveGameObject.GetComponent <Animator>();
        MyRigidbody        = AliveGameObject.GetComponent <Rigidbody2D>();
        MySpriteRenderer   = AliveGameObject.GetComponent <SpriteRenderer>();
        MyBoxCollider2D    = AliveGameObject.GetComponent <BoxCollider2D>();
        MyRopeLineRenderer = AliveGameObject.GetComponent <LineRenderer>();
        RopeJoint          = AliveGameObject.GetComponent <DistanceJoint2D>();

        DashDirectionIndicator = AliveGameObject.transform.Find("Dash Direction Indicator");

        RopeHingeAnchor               = AliveGameObject.transform.Find("Rope Hinge Anchor");
        RopeHingeAnchorRigidbody      = RopeHingeAnchor.GetComponent <Rigidbody2D>();
        RopeHingeAnchorSpriteRenderer = RopeHingeAnchor.GetComponent <SpriteRenderer>();

        Crosshair = AliveGameObject.transform.Find("Crosshair");
        CrosshairSpriteRenderer = Crosshair.GetComponent <SpriteRenderer>();

        InputHandler = GetComponent <PlayerInputHandler>();

        FacingDirection = 1;

        // PLAYER Create and Invoke event for UI
        SkillManager.AddSkill(DashState);
        SkillManager.AddSkill(OnRopeStateAim);
        SkillManager.AddSkill(FireArrowShotStateStart);

        OnRopeStateFinish.ResetRope();

        _playerHealthBar.SetMaxHealth(_playerStatsData.maxHealth);

        AliveGameObject.transform.position = FindObjectOfType <PlayerCheckpointManager>().LastCheckpoint;

        FiniteStateMachine.Initialize(IdleState);
    }
Esempio n. 7
0
 public static void HandleNewSkillCooldown(S_START_COOLTIME_SKILL p)
 {
     WindowManager.SkillsEnded = false;
     SkillManager.AddSkill(p.SkillId, p.Cooldown);
 }
 public static void HandleNewSkillCooldown(S_START_COOLTIME_SKILL p)
 {
     SkillManager.AddSkill(p.SkillId, p.Cooldown);
 }
Esempio n. 9
0
 public void Init(string _skillName, float _coolTime)
 {
     skillName = _skillName;
     coolTime  = _coolTime;
     SkillManager.AddSkill(this);
 }
Esempio n. 10
0
 public void AddSkill(int skillId, int rate)
 {
     SkillManager.AddSkill(skillId, Level, rate, SkillSourceTypes.Skill);
 }
Esempio n. 11
0
 public void AddRandSkill()
 {
     SkillManager.AddSkill(SkillBook.GetRandSkillId(), Level, 100, SkillSourceTypes.Skill);
 }
Esempio n. 12
0
 public ActionResult AddSkill(Skill skill)
 {
     sm.AddSkill(skill);
     return(View());
 }