Ejemplo n.º 1
0
        public override sealed void Killed(BaseCharacterEntity lastAttacker)
        {
            float     expLostPercentage = gameInstance.GameplayRule.GetExpLostPercentageWhenDeath(this);
            GuildData guildData;

            if (gameManager.TryGetGuild(GuildId, out guildData))
            {
                expLostPercentage -= expLostPercentage * guildData.DecreaseExpLostPercentage;
            }
            if (expLostPercentage <= 0f)
            {
                expLostPercentage = 0f;
            }
            int exp = Exp;

            exp -= (int)(this.GetNextLevelExp() * expLostPercentage / 100f);
            if (exp <= 0)
            {
                exp = 0;
            }
            Exp = exp;

            base.Killed(lastAttacker);
            currentNpcDialog = null;
        }
Ejemplo n.º 2
0
 protected override void SetFieldCondition()
 {
     if (cacheNpcDialog == null)
     {
         cacheNpcDialog = CreateInstance <NpcDialog>();
     }
     // Normal
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Normal.ToString(), cacheNpcDialog.GetMemberName(a => a.menus));
     // Quest
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Quest.ToString(), cacheNpcDialog.GetMemberName(a => a.quest));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Quest.ToString(), cacheNpcDialog.GetMemberName(a => a.questAcceptedDialog));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Quest.ToString(), cacheNpcDialog.GetMemberName(a => a.questDeclinedDialog));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Quest.ToString(), cacheNpcDialog.GetMemberName(a => a.questAbandonedDialog));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Quest.ToString(), cacheNpcDialog.GetMemberName(a => a.questCompletedDailog));
     // Shop
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.Shop.ToString(), cacheNpcDialog.GetMemberName(a => a.sellItems));
     // Craft Item
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.CraftItem.ToString(), cacheNpcDialog.GetMemberName(a => a.itemCraft));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.CraftItem.ToString(), cacheNpcDialog.GetMemberName(a => a.craftDoneDialog));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.CraftItem.ToString(), cacheNpcDialog.GetMemberName(a => a.craftNotMeetRequirementsDialog));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.CraftItem.ToString(), cacheNpcDialog.GetMemberName(a => a.craftCancelDialog));
     // Save Spawn Point
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.SaveRespawnPoint.ToString(), cacheNpcDialog.GetMemberName(a => a.menus));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.SaveRespawnPoint.ToString(), cacheNpcDialog.GetMemberName(a => a.saveRespawnMap));
     ShowOnEnum(cacheNpcDialog.GetMemberName(a => a.type), NpcDialogType.SaveRespawnPoint.ToString(), cacheNpcDialog.GetMemberName(a => a.saveRespawnPosition));
 }
Ejemplo n.º 3
0
        private void OnValidate()
        {
#if UNITY_EDITOR
            if (questCompletedDailog != null)
            {
                questCompletedDialog = questCompletedDailog;
                questCompletedDailog = null;
                EditorUtility.SetDirty(this);
            }
#endif
        }
Ejemplo n.º 4
0
        private void FindQuestFromDialog(NpcDialog dialog, List <NpcDialog> foundDialogs = null)
        {
            if (foundDialogs == null)
            {
                foundDialogs = new List <NpcDialog>();
            }

            if (dialog == null || foundDialogs.Contains(dialog))
            {
                return;
            }

            foundDialogs.Add(dialog);

            switch (dialog.type)
            {
            case NpcDialogType.Normal:
                foreach (NpcDialogMenu menu in dialog.menus)
                {
                    if (menu.isCloseMenu)
                    {
                        continue;
                    }
                    FindQuestFromDialog(menu.dialog, foundDialogs);
                }
                break;

            case NpcDialogType.Quest:
                if (dialog.quest != null)
                {
                    questIds.Add(dialog.quest.DataId);
                }
                FindQuestFromDialog(dialog.questAcceptedDialog, foundDialogs);
                FindQuestFromDialog(dialog.questDeclinedDialog, foundDialogs);
                FindQuestFromDialog(dialog.questAbandonedDialog, foundDialogs);
                FindQuestFromDialog(dialog.questCompletedDialog, foundDialogs);
                break;

            case NpcDialogType.CraftItem:
                FindQuestFromDialog(dialog.craftNotMeetRequirementsDialog, foundDialogs);
                FindQuestFromDialog(dialog.craftDoneDialog, foundDialogs);
                FindQuestFromDialog(dialog.craftCancelDialog, foundDialogs);
                break;

            case NpcDialogType.SaveRespawnPoint:
                FindQuestFromDialog(dialog.saveRespawnConfirmDialog, foundDialogs);
                FindQuestFromDialog(dialog.saveRespawnCancelDialog, foundDialogs);
                break;

            case NpcDialogType.Warp:
                FindQuestFromDialog(dialog.warpCancelDialog, foundDialogs);
                break;
            }
        }