public VBuff CreateBuff(string buffId, string skillId, int lvl, string casterId, string targetId, Vector3 targetPoint) { VBio caster = this.GetBio(casterId); VBio target = this.GetBio(targetId); return(this._buffManager.CreateBuff(buffId, skillId, lvl, caster, target, targetPoint)); }
protected override void DamageInternal(VBuff buff, VBio target, float damage) { if (buff.skillData.isCommon) { return; } int charge; if (!this._chargesPreSkill.TryGetValue(buff.skillData.id, out charge)) { this._chargesPreSkill[buff.skillData.id] = 0; charge = 0; } int maxChargePreSkill = ( int )this.extra[0]; if (charge < maxChargePreSkill) { ++this._totalCharges; ++charge; this._chargesPreSkill[buff.skillData.id] = charge > maxChargePreSkill ? maxChargePreSkill : charge; } if (this._totalCharges > ( int )this.extra[1]) { this._totalCharges = 0; this._chargesPreSkill.Clear(); } this.level = this._totalCharges / ( int )this.extra[3]; }
public void OnEntityCreated(VBio bio) { Skill[] skills = bio.skills; int count = bio.numSkills; for (int i = 1; i < count; i++) { Skill skill = skills[i]; GComponent skillGrid = this._skillGrids[i - 1]; skillGrid.data = skill.id; GLoader loader = skillGrid["n2"].asLoader; loader.url = skill.icon; loader.onClick.Add(this.OnSkillGridClick); GButton uButton = skillGrid["n5"].asButton; uButton.onClick.Add(this.OnSkillUpgradeBtnClick); loader.grayed = true; loader.touchable = false; skillGrid["mask"].asImage.fillAmount = 0; if (bio.property.skillPoint > 0) { skillGrid.GetController("c1").selectedIndex = 1; } } }
private void HandleEntityHurt(BaseEvent e) { UIEvent uiEvent = ( UIEvent )e; VBio target = ( VBio )uiEvent.target; float damage = uiEvent.f0; this._hudManager.OnEntityHurt(target, damage); }
private void HandleRelive(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio bio = this.GetBio(e.targetId); bio.HandleRelive(e.position.ToVector3(), e.direction.ToVector3()); }
private void HandleBuffStateTriggered(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio bio = this.GetBio(e.targetId); bio.HandleBuffStateTriggered(e.buffStateId, e.triggerIndex); }
private void HandleBuffStateRemoved(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio bio = this.GetBio(e.targetId); bio.HandleBuffStateRemoved(e.buffStateId); }
private void HandleTriggerTarget(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBuff buff = this.GetBuff(e.buffId); VBio target = this.GetBio(e.targetId); target.HandleTrigger(buff, e.triggerIndex); }
private void HandleExitBuff(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBuff buff = this.GetBuff(e.buffId); VBio target = this.GetBio(e.targetId); target.HandleExitBuff(buff); }
public VBio CreateBio(EntityParam param) { VBio entity = this.CreateEntity <VBio>(param); this._idToBio[param.rid] = entity; this._bios.Add(entity); return(entity); }
private void HandleBuffStateAdded(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio bio = this.GetBio(e.targetId); VBuff buff = this.GetBuff(e.buffId); bio.HandleBuffStateAdded(e.buffStateId, buff); }
private void HandleEntityDie(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio bio = this.GetBio(e.targetId); VBio killer = this.GetBio(e.casterId); bio.HandleDie(killer); }
protected override void OnExit() { this.owner.usingSkill = null; if (!string.IsNullOrEmpty(this._skill.action)) { this.owner.graphic.animator.SetClipSpeed(this._skill.action, 1f); } this._skill = null; this._target = null; }
public static void Hurt(VBuff buff, VBio caster, VBio target, float damage) { UIEvent e = Get(); e.type = UIEventType.HURT; e.buff = buff; e.entity = caster; e.target = target; e.f0 = damage; e.Invoke(); }
private void HandleDamage(BaseEvent baseEvent) { SyncEvent e = ( SyncEvent )baseEvent; VBio caster = this.GetBio(e.casterId); VBio target = this.GetBio(e.targetId); VBuff buff = this.GetBuff(e.buffId); caster.HandleDamage(buff, target, e.f0); target.HandleHurt(buff, caster, e.f0); }
public void OnEntityDestroied(VBio bio) { HUD hud; if (!this._idToHud.TryGetValue(bio.rid, out hud)) { return; } this._idToHud.Remove(bio.rid); this.root.RemoveChild(hud.root); hud.Release(); PushHUD(hud); }
public VBuff CreateBuff(string rid, string skillId, int lvl, VBio caster, VBio target, Vector3 targetPoint) { bool isNew = this._gPool.Pop(out VBuff buff); this._buffs.Add(buff); this._idToBuff[rid] = buff; if (isNew) { buff.Init(this._battle); } buff.OnAddedToBattle(rid, skillId, lvl, caster, target, targetPoint); return(buff); }
private void InternalCreate(VBio bio) { if (!bio.canInteractive) { return; } HUD hud = PopHUD(); hud.owner = bio; hud.visible = bio.graphic.visible; this._idToHud[bio.rid] = hud; this.root.AddChild(hud.root); hud.Update(); }
protected override void OnEnter(object[] param) { this._skill = this.owner.GetSkill(( string )param[0]); this._target = this.owner.battle.GetBio(( string )param[1]); this.owner.usingSkill = this._skill; string action = this._skill.action; if (!string.IsNullOrEmpty(action)) { this.owner.graphic.animator.SetClipSpeed(action, this._skill.actionLength / this._skill.atkTime); this.owner.graphic.animator.CrossFade(action); } this._time = 0f; this._fxTime = this._skill.atkFxTime / this.owner.property.attackSpeedFactor; }
public void OnEntityCreated(VBio bio) { //先处理玩家自己,其他实体先放入队列 if (VPlayer.instance == null) { this._delayQueue.Enqueue(bio); } else { this.InternalCreate(bio); while (this._delayQueue.Count > 0) { bio = this._delayQueue.Dequeue(); this.InternalCreate(bio); } } }
public void OnEntityCreated(VBio bio) { int count = this._root.numChildren; for (int i = 0; i < count; i++) { GObject child = this._root.GetChildAt(i); if (!child.name.StartsWith("a_")) { continue; } int n = int.Parse(child.name.Substring(2)); Attr attr = ( Attr )n; GTextField tf = child.asTextField; tf.text = string.Empty + VPlayer.instance.property[attr]; } }
internal void Init(string id, VBuff buff, VBio owner) { this.owner = owner; this.buff = buff; this._data = ModelFactory.GetBuffStateData(id); int index = Mathf.Min(this.buff.property.lvl, this._data.levels.Length - 1); this.duration = this._data.levels[index].duration; this.trigger = this._data.levels[index].trigger; this.fxs = this._data.levels[index].fxs; this.attrs = this._data.levels[index].attrs; this.values = this._data.levels[index].values; this.extra = this._data.levels[index].extra; this.extra_s = this._data.levels[index].extra_s; if (this.fxs != null) { int count = this.fxs.Length; for (int i = 0; i < count; i++) { Effect mfx = this.owner.battle.CreateEffect(this.fxs[i]); mfx.SetupTerritory(this.buff.caster, this.owner, this.buff.targetPoint); if (mfx.lifeTime <= 0) { if (this._fxs == null) { this._fxs = new List <Effect>(); } this._fxs.Add(mfx); } } } this._elapsed = 0f; this.CreateInternal(); }
public void OnEntityHurt(VBio target, float damage) { PopText popText = PopText.Create(); popText.PopHurt(this.root, target, damage, false); }
public void OnDamage(VBuff buff, VBio target, float damage) { this.DamageInternal(buff, target, damage); }
public void OnHurt(VBuff buff, VBio caster, float damage) { this.HurtInternal(buff, caster, damage); }
protected virtual void HurtInternal(VBuff vBuff, VBio caster, float damage) { }
protected virtual void DamageInternal(VBuff vBuff, VBio target, float damage) { }