private void OnUpgradeLevel() { this.ActorCard.SetLevel(); RefreshBoardEventArgs eventArgs = ReferencePool.Acquire <RefreshBoardEventArgs>(); int maxHp = Attrbute.GetValue(AttributeType.MaxHp); int curHp = Attrbute.GetValue(AttributeType.Hp); eventArgs.Fill(EntityId, maxHp, curHp, ActorCard.Level); GameEntry.Event.Fire(this, eventArgs); RefreshHeroInfoEventArgs args = ReferencePool.Acquire <RefreshHeroInfoEventArgs>().FillLevel(ActorCard.Level); GameEntry.Event.Fire(this, args); int id = GameEntry.Entity.GenerateTempSerialId(); EffectData data = new EffectData(id, Constant.Define.LevelUpEffect); data.Owner = this; data.KeepTime = 3; data.BindType = EffectBindType.OwnFoot; data.DeadType = FlyObjDeadType.UntilLifeTimeEnd; data.Parent = CachedTransform; data.SetParent = true; GameEntry.Entity.ShowEffect(data); }
public override void Init() { base.Init(); GameEntry.Event.Subscribe(ChangeEquipEventArgs.EventId, ChangeEquipAvatar); GameEntry.Event.Subscribe(SkillKeyDownEventArgs.EventId, TryUseSkill); GameEntry.Event.Subscribe(KillMonsterEventArgs.EventId, OnKillMonster); GameEntry.Event.Subscribe(ChangeAiModeEventArgs.EventId, OnChangeAiMode); GameEntry.Event.Subscribe(ChangeVehicleEventArgs.EventId, OnChangeVehicle); GameEntry.Event.Subscribe(ChangePartnerEventArgs.EventId, OnChangePartner); m_OriginalParent = CachedTransform.parent; m_Vehicle = this; BattleState = false; RefreshBoardEventArgs eventArgs = ReferencePool.Acquire <RefreshBoardEventArgs>(); int maxHp = Attrbute.GetValue(AttributeType.MaxHp); int curHp = Attrbute.GetValue(AttributeType.Hp); eventArgs.Fill(EntityId, maxHp, curHp, ActorCard.Level); GameEntry.Event.Fire(this, eventArgs); BroadcastHeroInfo(); InitPartner(); GameEntry.Level.CreatePlayerActor(this); }
protected virtual void UpdateHealth() { RefreshBoardEventArgs eventArgs = ReferencePool.Acquire <RefreshBoardEventArgs>(); int maxHp = Attrbute.GetValue(AttributeType.MaxHp); int curHp = Attrbute.GetValue(AttributeType.Hp); eventArgs.Fill(EntityId, maxHp, curHp, m_ActorData.Level); GameEntry.Event.Fire(this, eventArgs); }
public void OnRefreshBoard(object sender, GameEventArgs e) { RefreshBoardEventArgs ne = e as RefreshBoardEventArgs; if (ne == null) { return; } int boardId; if (m_BoardForms.TryGetValue(ne.OwnerId, out boardId)) { UIForm uiform = GameEntry.UI.GetUIForm(boardId); RoleBoardForm borderForm = uiform?.Logic as RoleBoardForm; borderForm?.Refresh(ne.CurHp, ne.MaxHp, ne.Level); } }