void Start() { this.contagionProgressController = FindObjectOfType <ContagionProgressController>(); this.controller = GetComponent <CharacterController>(); this.gameController = FindObjectOfType <GameController>(); this.buffController = FindObjectOfType <BuffController>(); }
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++; } } }
private void Start() { TargetIndicatorController = GetComponentInChildren <TargetIndicatorController>(); _actionAnimator = GetComponentInChildren <Animator>(); _healthBar = GetComponentInChildren <HealthBar>(); _buffController = GetComponentInChildren <BuffController>(); }
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(); } }
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> (); }
public BuffController AddBuffCtrl(Unit Owner) { BuffController ctrl = new BuffController(); ctrl.Owner = Owner; BuffControllers.Add(ctrl); return(ctrl); }
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; }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
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>(); }
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; }
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; }
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)); } }
/// <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); }
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; } } } }
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(); }
/******************* 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; }
/// <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); }
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); }
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; }
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(); }
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); }
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); }
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(); }
void Start() { this.buffController = FindObjectOfType <BuffController>(); }
public void GiveImpassibleBuff(float time) { StartCoroutine(BuffController.ImpassibleBuff(this, time)); }
// Use this for initialization void Start() { _buffController = gameController.GetComponent <BuffController>(); _gameController = gameController.GetComponent <GameController>(); }
public void LifeOver() { m_instance = null; }
public void OnDestroy() { m_instance = null; m_anim = null; }