示例#1
0
文件: Player.cs 项目: GunnerJnr/lib9c
        public void GetExp(long waveExp, bool log = false)
        {
            Exp.Current += waveExp;

            if (log)
            {
                var getExp = new GetExp((CharacterBase)Clone(), waveExp);
                Simulator.Log.Add(getExp);
            }

            if (Exp.Current < Exp.Max)
            {
                return;
            }

            var level = Level;

            Level = characterLevelSheet.GetLevel(Exp.Current);
            // UI에서 레벨업 처리시 NRE 회피
            if (level < Level)
            {
                eventMap?.Add(new KeyValuePair <int, int>((int)QuestEventType.Level, Level - level));
            }

            UpdateExp();
        }
示例#2
0
        public void GetExp(long waveExp, bool log = false)
        {
            if (!characterLevelSheet.TryGetLevel(Exp.Current + waveExp, out var newLevel))
            {
                waveExp  = Exp.Max - Exp.Current - 1;
                newLevel = Level;
            }

            Exp.Current += waveExp;

            if (log)
            {
                var getExp = new GetExp((CharacterBase)Clone(), waveExp);
                Simulator.Log.Add(getExp);
            }

            if (Level == newLevel)
            {
                return;
            }

            if (Level < newLevel)
            {
                eventMap?.Add(new KeyValuePair <int, int>((int)QuestEventType.Level, newLevel - Level));
            }
            Level = newLevel;

            UpdateExp();
        }
示例#3
0
文件: Player.cs 项目: GunnerJnr/lib9c
        // ToDo. 지금은 스테이지에서 재료 아이템만 주고 있음. 추후 대체 불가능 아이템도 줄 경우 수정 대상.
        public CollectionMap GetRewards(List <ItemBase> items)
        {
            var map = new CollectionMap();

            foreach (var item in items)
            {
                map.Add(Inventory.AddItem(item));
            }

            return(map);
        }
示例#4
0
文件: Player.cs 项目: GunnerJnr/lib9c
 protected override void OnDead()
 {
     base.OnDead();
     eventMap.Add(new KeyValuePair <int, int>((int)QuestEventType.Die, 1));
 }
示例#5
0
文件: Player.cs 项目: GunnerJnr/lib9c
 public void RemoveTarget(Enemy enemy)
 {
     monsterMap.Add(new KeyValuePair <int, int>(enemy.RowData.Id, 1));
     Targets.Remove(enemy);
     Simulator.Characters.TryRemove(enemy);
 }