Ejemplo n.º 1
0
 void Start()
 {
     this.contagionProgressController = FindObjectOfType <ContagionProgressController>();
     this.controller     = GetComponent <CharacterController>();
     this.gameController = FindObjectOfType <GameController>();
     this.buffController = FindObjectOfType <BuffController>();
 }
Ejemplo n.º 2
0
        public static void AddWarBuffs(BattleType battleType, List <string> attackerBuffs, List <string> defenderBuffs)
        {
            BuffController buffController = Service.BuffController;

            buffController.ClearWarBuffs();
            if (battleType != BattleType.PvpAttackSquadWar && battleType != BattleType.PveBuffBase)
            {
                return;
            }
            StaticDataController staticDataController = Service.StaticDataController;

            if (attackerBuffs != null)
            {
                int i     = 0;
                int count = attackerBuffs.Count;
                while (i < count)
                {
                    WarBuffVO warBuff = staticDataController.Get <WarBuffVO>(attackerBuffs[i]);
                    buffController.AddAttackerWarBuff(warBuff);
                    i++;
                }
            }
            if (battleType != BattleType.PveBuffBase && defenderBuffs != null)
            {
                int j      = 0;
                int count2 = defenderBuffs.Count;
                while (j < count2)
                {
                    WarBuffVO warBuff2 = staticDataController.Get <WarBuffVO>(defenderBuffs[j]);
                    buffController.AddDefenderWarBuff(warBuff2);
                    j++;
                }
            }
        }
Ejemplo n.º 3
0
 private void Start()
 {
     TargetIndicatorController = GetComponentInChildren <TargetIndicatorController>();
     _actionAnimator           = GetComponentInChildren <Animator>();
     _healthBar      = GetComponentInChildren <HealthBar>();
     _buffController = GetComponentInChildren <BuffController>();
 }
Ejemplo n.º 4
0
 public BatallaController(GenericModelController enemyCon, PlayerModelController playerCon)
 {
     buffos      = new BuffController();
     enemy       = new DefaultEnemy(enemyCon);
     player      = new Player(playerCon, buffos, enemy);
     turnoPlayer = true;
 }
    void Start()
    {
        audio          = GetComponent <AudioController>();
        timer          = GetComponent <CentralTimer>();
        devController  = gameObject.GetComponent <DevController>();
        buffController = gameObject.GetComponent <BuffController>();

        setSceneText = GetComponent <SetPlaySceneText>();

        resetMinGames = resetBaseMinGames;

        max            = initialMax;
        reward         = initialReward;
        maxScaleFactor = initialMaxScaleFactor;
        coins          = initialCoins;
        progress       = 0;
        gameCounter    = 0;

        setSceneText.LoadTextSource();

        if (LoadState.LoadSituation)
        {
            loadGame();
        }
    }
Ejemplo n.º 6
0
    private void ReferObjects()
    {
        //Fish Controller Refer
        FishController fishControl = gameObject.GetComponent <FishController>();

        fishControl.headHitBox         = hitBox;
        fishControl.fishIndicator      = ingamePlayerName.GetComponent <FishTextMesh>();
        fishControl.tFishHead          = fishHead.transform;
        fishControl.tFishBodies        = fishBodies.transform;
        fishControl.fishHead           = theHeadObject;
        fishControl.buffControl        = theHeadObject.GetComponent <BuffController> ();
        fishControl.fishIdleController = gameObject.GetComponent <IdleController> ();
        fishControl.fishLevelControl   = theHeadObject.GetComponent <FishLevelController> ();
        fishControl.fishEyeControl     = theFishEyes.GetComponent <FishEyeController> ();
        fishControl.fishHSVControl     = fishHead.GetComponent <FishHSVController> ();

        //Idle Controller Refer
        IdleController idleControl = gameObject.GetComponent <IdleController>();

        idleControl.fishAnimator  = theFish.GetComponent <Animator> ();
        idleControl.fishTransform = gameObject.transform;

        //Mesh Renderers Fish Refer
        MeshRenderersFish renderFish = fishHead.GetComponent <MeshRenderersFish>();

        renderFish.fishMeshRenderer = theFish.GetComponent <MeshRenderer> ();
        renderFish.fishText         = playerName.GetComponent <MeshRenderer> ();

        //Fish HSV Controller Refer
        FishHSVController fishHSVControl = fishHead.GetComponent <FishHSVController>();

        fishHSVControl.fish        = fishHead.GetComponent <MeshRenderersFish> ();
        fishHSVControl.fishEye     = theFishEyes.GetComponent <FishEyeController>();
        fishHSVControl.blinkEffect = shineEffect;

        //Shadow Controller Refer
        ShadowController shadowControl = fishShadow.GetComponent <ShadowController>();

        shadowControl.fishTransform = theFish.transform;

        //Buff Controller Refer
        BuffController buffControl = theHeadObject.GetComponent <BuffController>();

        buffControl.BuffAnimation       = buffParent.transform.GetChild(0).GetComponent <SkeletonAnimation> ();
        buffControl.fishRenderers       = fishHead.GetComponent <MeshRenderersFish> ();
        buffControl.buffParentTransform = buffParent.transform;
        buffControl.buffAnimationObject = buffParent.transform.GetChild(0).gameObject;
        buffControl.nosBuffGameObject   = buffParent.transform.GetChild(1).gameObject;

        //Fish Level Controller Refer - Fish Skin Name per level Previously included
        FishLevelController fishLevelControl = theHeadObject.GetComponent <FishLevelController>();

        fishLevelControl.fishControllerTransform = gameObject.transform;
        fishLevelControl.fish         = theFish.GetComponent <SkeletonAnimator> ();
        fishLevelControl.fishAnimator = theFish.GetComponent <Animator> ();
        fishLevelControl.fishRend     = fishHead.GetComponent <MeshRenderersFish> ();
        fishLevelControl.mouthAnim    = theFish.transform.GetChild(0).GetComponent <MouthAnimationController> ();
    }
Ejemplo n.º 7
0
    public BuffController AddBuffCtrl(Unit Owner)
    {
        BuffController ctrl = new BuffController();

        ctrl.Owner = Owner;
        BuffControllers.Add(ctrl);

        return(ctrl);
    }
Ejemplo n.º 8
0
 public Hero(int index)
 {
     _core         = Camera.main.GetComponent <MainCore>();
     _battleCon    = _core._battleCon;
     _heroCom      = _core._heroCom;
     _buffCon      = _core._buffCon;
     _selectATKCon = _core._selectATKCon;
     _avatar       = _heroCom._heroAvatarList[index];
     _anim         = _avatar.GetComponent <Animator>();
     slotId        = index;
 }
Ejemplo n.º 9
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Ejemplo n.º 10
0
 protected override void Attack()
 {
     Collider2D[] colliders = Physics2D.OverlapBoxAll(transform.position, new Vector2(attackRadius, attackRadius), 0, towerLayer);
     if (colliders.Length != 0)
     {
         int attackT = Random.Range(0, colliders.Length);
         colliders[attackT].GetComponent <Tower>().GetDamaged(attack * attackRate);
         colliders[attackT].GetComponent <Tower>().StartCoroutine(BuffController.BurningBuff(colliders[attackT].gameObject, burningDamage, burningTime));
     }
     state = State.Move;
 }
 private void Awake()
 {
     _core                     = Camera.main.GetComponent <MainCore>();
     _cal                      = _core._cal;
     _mapCon                   = _core._mapCon;
     _monCom                   = _core._monCom;
     _heroCom                  = _core._heroCom;
     _buffCon                  = _core._buffCon;
     _selectATKCon             = _core._selectATKCon;
     _buffCon._buffListPlayer  = new List <Buff>();
     _buffCon._buffListMonster = new List <Buff>();
 }
Ejemplo n.º 12
0
    void Start()
    {
        backgroundProgressRectTransform = GameObject.FindGameObjectWithTag("BackgroundContagionProgress").GetComponent <RectTransform>();
        overlayProgressRectTransform    = GameObject.FindGameObjectWithTag("OverlayContagionProgress").GetComponent <RectTransform>();
        percentageContagionProgress     = GameObject.FindGameObjectWithTag("PercentageContagionProgress").GetComponent <Text>();

        alert          = FindObjectOfType <Alert>();
        gameController = FindObjectOfType <GameController>();
        buffController = FindObjectOfType <BuffController>();

        accDeltaInfectionFreeMessage = 0f;
        isAnimatingBar = false;
        showingMessage = false;
    }
Ejemplo n.º 13
0
    IEnumerator BuffLifeTime(GameObject cell, Item item)
    {
        isBuffAvtive = true;
        float circleTime     = 0.1f;
        float buffActiveTime = 0f;

        Buff buff   = item.itemBuff.buff;
        bool isBuff = item.itemBuff.buff.buffType.ToString().EndsWith("Debuff");

        buffController = Global.Component.GetBuffController();
        Text buffTimeText = transform.GetChild(1).GetComponent <Text>();

        if (item.itemBuff.buffTime < 0)
        {
            buffTimeLeft = float.MaxValue;

            while (isBuffAvtive == true)
            {
                buffTimeText.text = "999+";
                yield return(new WaitForSeconds(circleTime));
            }
        }
        else
        {
            while (buffActiveTime <= item.itemBuff.buffTime)
            {
                buffActiveTime   += circleTime;
                buffTimeLeft      = item.itemBuff.buffTime - buffActiveTime;
                buffTimeText.text = buffTimeLeft.ToString("0.00");

                if (buff.debuffToRemove != null)
                {
                    if (buff.IsBuffed() == false)
                    {
                        if (buffController.IsBuffExistByTypeName(buff.debuffToRemove.buffType, isBuff) == false)
                        {
                            buff.BuffDirty();
                        }
                    }
                }

                yield return(new WaitForSeconds(circleTime));
            }
        }

        eventController.OnRemoveBuffEvent.Invoke(cell, item);

        isBuffAvtive = false;
    }
Ejemplo n.º 14
0
        public Instance(int id, BuffController buff_group, int initial_stack_count = 1)
        {
            this.id         = id;
            this.buff_group = buff_group;

            is_active = false;

            stack_count = initial_stack_count;

            buffs = new List <IChildBuff>();
            foreach (BuffDefinition buff in buff_group.buffs)
            {
                buffs.Add(buff.GetChildInstance(this));
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 存储玩家身上buff列表信息;
        /// </summary>
        /// <param name="_hostId"></param>
        /// <param name="pbufflist">注意:这里的pbuff只取id, lv</param>
        /// <returns></returns>
        public bool AddBuff(string _hostId, List <PBuff> pbufflist, bool autoEndPlayPreBuff = false)
        {
            if (autoEndPlayPreBuff)
            {
                SetBuffEndPlay(_hostId);
            }
            BuffController bc = null;

            foreach (PBuff pb in pbufflist)
            {
                bc = new BuffController();
                bc.SetVo(_hostId, pb.id, pb.lvl);
                AddBuff(_hostId, bc);
            }
            return(true);
        }
Ejemplo n.º 16
0
 public void RemoveBuff(string _hostId, BuffController bc)
 {
     if (mBuffList.ContainsKey(_hostId))
     {
         List <BuffController> _tmpBufList = mBuffList[_hostId];
         foreach (BuffController tmpBuff in _tmpBufList)
         {
             if (tmpBuff.isEqual(bc))
             {
                 tmpBuff.Dispose();
                 _tmpBufList.Remove(tmpBuff);
                 break;
             }
         }
     }
 }
Ejemplo n.º 17
0
Archivo: Buff.cs Proyecto: spock254/sza
    public void DeBuffDirty()
    {
        if (eventController == null)
        {
            eventController = Global.Component.GetEventController();
        }

        if (buffController == null)
        {
            buffController = Global.Component.GetBuffController();
        }

        Type  type = Type.GetType(buffType.ToString());
        IBuff buff = (IBuff)Activator.CreateInstance(type);

        buff.Debuff();
    }
Ejemplo n.º 18
0
    /******************* Unity Function *******************/
    protected virtual void Awake()
    {
        m_HasPlayed = false;
        m_CanPlay   = true;

        m_Body          = transform.Find("Body").gameObject;
        m_ArmorCollider = m_Body.GetComponent <Collider> ();

        m_MoveController    = transform.GetComponent <MoveController> ();
        m_BuffController    = transform.GetComponent <BuffController> ();
        m_WeaponController  = transform.GetComponent <WeaponController> ();
        m_PassiveController = transform.GetComponent <PassiveController> ();
        m_HUDController     = transform.GetComponent <HUDController> ();

        m_ArmorReductionMultiplier  = 1;
        m_ShieldReductionMultiplier = 1;
    }
Ejemplo n.º 19
0
        /// <summary>
        /// 自动更加状态表判断是否能增加指定buff,不能增加的话返回false;
        /// </summary>
        /// <param name="_hostId"></param>
        /// <param name="_buffVo"></param>
        /// <returns></returns>
        public bool AddBuff(string _hostId, BuffController _buffController)
        {
            List <BuffController> _tmpBufList;

            if (false == mBuffList.ContainsKey(_hostId))
            {
                _tmpBufList = new List <BuffController>();
            }
            else
            {
                _tmpBufList = mBuffList[_hostId];
            }
            if (IsCanAddBuff(_hostId, _buffController))
            {
                _tmpBufList.Add(_buffController);
                mBuffList[_hostId] = _tmpBufList;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 20
0
Archivo: Buff.cs Proyecto: spock254/sza
    public void BuffActivate(Item item)
    {
        if (eventController == null)
        {
            eventController = Global.Component.GetEventController();
        }

        if (buffController == null)
        {
            buffController = Global.Component.GetBuffController();
        }

        if (buffController.IsBuffExist(item) == false)
        {
            Type  type = Type.GetType(buffType.ToString());
            IBuff buff = (IBuff)Activator.CreateInstance(type);
            buff.Buff();
        }

        eventController.OnAddBuffEvent.Invoke(item);
    }
Ejemplo n.º 21
0
    void baseSetUp()
    {
        controllerObj  = GameObject.Find("GameController");
        controller     = controllerObj.GetComponent <GameController>();
        buffController = controller.GetComponent <BuffController>();

        sprite = transform.Find("Sprite").GetComponent <Animator>();

        devText = GameText.text.PlayScene.DevInfo;

        lvlString    = devText.LevelIndicator + lvl;
        expBar.value = (float)exp / maxExp;
        expGain      = baseExpGain;

        energy = 100;

        trainPeriod = prodPeriod * 0.5f;

        energyGain = setEnergyGain();
        energyLoss = setEnergyLoss();
        sprite.runtimeAnimatorController = typeData.artwork;
    }
Ejemplo n.º 22
0
 private void Awake()
 {
     opsc             = GetComponent <OperationSoundController>();
     weaponController = GetComponent <WeaponController>();
     opc                      = GetComponent <OperationController>();
     skillController          = GetComponent <SkillController>();
     buffController           = GetComponent <BuffController>();
     combatController         = GetComponent <CombatController>();
     knockBackSystem          = GetComponent <KnockStunSystem>();
     dieController            = GetComponent <DieController>();
     iconController           = GetComponent <IconController>();
     cumulativeDataController = GetComponent <CumulativeDataController>();
     rb             = GetComponent <Rigidbody2D>();
     anim           = GetComponent <Animator>();
     animController = new AnimatorOverrideController(anim.runtimeAnimatorController);
     _attack        = new CommonAttackControl(this);
     anim.runtimeAnimatorController = animController;
     cycleAttackCount    = data.cycleAttackCount;
     nextAttackResetTime = 0;
     attackComboCount    = 0;
     ReBorn();
 }
Ejemplo n.º 23
0
    int GetBuffStack(BuffController buffController)
    {
        int value = 0;

        if (string.IsNullOrEmpty(skillData.buffID))
        {
            return(value);
        }



        for (int i = 0; i < buffController.buffList.Count; i++)
        {
            if (buffController.buffList[i].baseData.id == skillData.buffID)
            {
                value = buffController.buffList[i].stack;
                //Debug.Log("버프 스텍 " + value);
            }
        }

        return(value);
    }
Ejemplo n.º 24
0
    public void Debuff()
    {
        //Debug.Log(WalkSpeedDebuff.rebuff != null);
        //Debug.Log("-------------- WalkSpeedDebuff");
        playerMovement.speed = playerOriginMovement;

        if (WalkSpeedDebuff.rebuff != null)
        {
            if (buffController == null)
            {
                buffController = Global.Component.GetBuffController();
            }

            if (buffController.IsBuffExistByTypeName(BuffType.WalkSpeedBuff))
            {
                WalkSpeedDebuff.rebuff.Buff();
                WalkSpeedDebuff.rebuff = null;
            }
        }

        //Debug.Log(playerMovement.speed);
    }
Ejemplo n.º 25
0
    BuffController buffController;          // для инита бафов при одетом шмоте в функции InitItemInInventory()

    void Start()
    {
        instance = this;
        //DontDestroyOnLoad(transform.gameObject);
        // еслт какое-то окно активно, запретить управление
        actionWindow       = Global.Component.GetActionWindowController();
        dialogWindow       = Global.Component.GetDialogueManager();
        actionPanel        = Global.Component.GetActionPanelController();
        playerMovement     = Global.Obj.GetPlayerGameObject().GetComponent <PlayerMovement>();
        terminalController = Global.Component.GetTerminalController();
        buffController     = Global.Component.GetBuffController();

        InitCells();
        InitItemInInventory();
        currentHand = left_hand_btn;

        SetHandColor();
        // отресовка всех одетых вещей
        UpdateAllEqupment();

        SetBagCellList();
        SetSellList();
        SetInvCellList();
    }
Ejemplo n.º 26
0
 void Start()
 {
     this.buffController = FindObjectOfType <BuffController>();
 }
Ejemplo n.º 27
0
 public void GiveImpassibleBuff(float time)
 {
     StartCoroutine(BuffController.ImpassibleBuff(this, time));
 }
Ejemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     _buffController = gameController.GetComponent <BuffController>();
     _gameController = gameController.GetComponent <GameController>();
 }
Ejemplo n.º 29
0
 public void LifeOver()
 {
     m_instance = null;
 }
Ejemplo n.º 30
0
 public void OnDestroy()
 {
     m_instance = null;
     m_anim     = null;
 }