123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- # DH_QuestManager
- if $ARGS[0] = 'UpdateStoryCard':
- !! Character Card
- if (ARRPOS('$dhCh_Chars_', 'Player') ! -1):
- func('Screen', 'Replace', 'PLAYER_LEVEL', '<<dhCh_Level[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_XP', '<<dhCh_Exp[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_HP', '<<dhCh_Health[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_SP', '<<dhCh_Stamina[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MP', '<<dhCh_Mana[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_RP', '<<dhCh_Rage[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_EP', '<<dhCh_Energy[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXXP', '<<dhCh_ExpMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXHP', '<<dhCh_HealthMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXSP', '<<dhCh_StaminaMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXMP', '<<dhCh_ManaMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXRP', '<<dhCh_RageMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_MAXEP', '<<dhCh_EnergyMax[''Player'']>>')
- func('Screen', 'Replace', 'PLAYER_GOLD', '<<dhInv_Gold[''Player'']>>')
- func('Screen', 'Replace', 'EXP_PERCENT', 'calc(<<dhCh_Exp[''Player'']>>%/<<dhCh_ExpMax[''Player'']>>*100)')
-
- func('Screen', '<<iif(dhCh_ManaMax[''Player''] ! 0, ''Show'', ''Hide'')>>', 'storyCardMP')
- func('Screen', '<<iif(dhCh_RageMax[''Player''] ! 0, ''Show'', ''Hide'')>>', 'storyCardRP')
- func('Screen', '<<iif(dhCh_EnergyMax[''Player''] ! 0, ''Show'', ''Hide'')>>', 'storyCardEP')
- else
- func('Screen', 'Replace', 'PLAYER_LEVEL', '0')
- func('Screen', 'Replace', 'PLAYER_XP', '0')
- func('Screen', 'Replace', 'PLAYER_HP', '2')
- func('Screen', 'Replace', 'PLAYER_SP', '1')
- func('Screen', 'Replace', 'PLAYER_MP', '?')
- func('Screen', 'Replace', 'PLAYER_RP', '?')
- func('Screen', 'Replace', 'PLAYER_EP', '?')
- func('Screen', 'Replace', 'PLAYER_MAXXP', '10')
- func('Screen', 'Replace', 'PLAYER_MAXHP', '5')
- func('Screen', 'Replace', 'PLAYER_MAXSP', '5')
- func('Screen', 'Replace', 'PLAYER_MAXMP', '???')
- func('Screen', 'Replace', 'PLAYER_MAXRP', '???')
- func('Screen', 'Replace', 'PLAYER_MAXEP', '???')
- func('Screen', 'Replace', 'PLAYER_GOLD', '0')
- func('Screen', 'Replace', 'EXP_PERCENT', '0%')
-
- func('Screen', 'Hide', 'storyCardMP')
- func('Screen', 'Hide', 'storyCardRP')
- func('Screen', 'Hide', 'storyCardEP')
- end
- end
- if $ARGS[0] = 'Init':
- KILLVAR '$DhQst_List_'
- KILLVAR '$DhQst_Msg_'
-
- $DhQst_List_[] = 'NewBeginnings'
- $DhQst_List_[] = 'CharacterCreation'
-
- $DhQst_Msg_['NoQuest'] = 'Warning: No Quest by the name of ''{0}'' exists.'
- $DhQst_Msg_['NoSubQuest'] = 'Warning: No SubQuest by the name of ''{0}'' exists in the quest ''{1}''.'
- $DhQst_Msg_['QuestStarted'] = 'Warning: ''{0}'' has already been started.'
- $DhQst_Msg_['QuestComplete'] = 'Warning: ''{0}'' has already been completed.'
- $DhQst_Msg_['QuestNotStarted'] = 'Warning: ''{0}'' has not been started yet.'
-
- $dhQst_Current = ''
- KILLVAR '$dhQst_Title'
- KILLVAR '$dhQst_Started'
- KILLVAR '$dhQst_Finished'
- KILLVAR '$dhQst_Progress'
- KILLVAR '$dhQst_SubQst_'
-
- gs 'DH_QuestManager', 'UpdateStoryCard'
- end
- if $ARGS[0] = 'Start':
- $.questName = $ARGS[1]
-
- !! Check if quest exists
- if ARRPOS('$DhQst_List_', $.questName) = -1:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName)
- msg($RESULT)
- exit
- end
-
-
- if dhQst_Started[$.questName] = False:
- $RESULT = 'Quest Started'
- $scr_Layout = 'dhScr_Def'
- func('Screen', 'ClearAll')
- gs 'DH_Quest_<<$.questName>>', 'Start'
- else
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestStarted'], $.questName)
- msg($RESULT)
- exit
- end
- end
- if $ARGS[0] = 'Restart':
- $.questName = $ARGS[1]
-
- !! Check if quest exists
- if ARRPOS('$DhQst_List_', $.questName) = -1:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName)
- msg($RESULT)
- exit
- end
-
- if dhQst_Started[$.questName] = True:
- $scr_Layout = 'dhScr_Def'
- func('Screen', 'ClearAll')
- gs 'DH_QuestManager', 'UpdateStoryCard'
- gs 'DH_Quest_<<$.questName>>', 'Start'
- else
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName)
- msg($RESULT)
- exit
- end
- end
- if $ARGS[0] = 'Continue':
- $.questName = $ARGS[1]
-
- !! Check if quest exists
- if ARRPOS('$DhQst_List_', $.questName) = -1:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName)
- msg($RESULT)
- exit
- end
-
- !! Check if quest has been started yet
- if dhQst_Started[$.questName] = False:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName)
- msg($RESULT)
- exit
- end
-
- if dhQst_Finished[$.questName] = False:
- $scr_Layout = 'dhScr_Def'
- func('Screen', 'ClearAll')
- gs 'DH_QuestManager', 'UpdateStoryCard'
- gs 'DH_Quest_<<$.questName>>', $dhQst_Progress[$.questName]
- else
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName)
- msg($RESULT)
- exit
- end
- end
- if $ARGS[0] = 'GoTo':
- $.questName = $ARGS[1]
- $.subQuest = $ARGS[2]
- .clearScreen = ARGS[3]
-
- !! Check if quest exists
- if ARRPOS('$DhQst_List_', $.questName) = -1:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName)
- msg($RESULT)
- exit
- end
-
- !! Check if quest has been started yet
- if dhQst_Started[$.questName] = False:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName)
- msg($RESULT)
- exit
- end
-
- !! Check if sub quest exists
- func('DH_Quest_<<$.questName>>', 'GetSubQuests')
- if (ARRPOS('$dhQst_SubQst_', $.subQuest) = -1):
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoSubQuest'], $.subQuest, $.questName)
- msg($RESULT)
- exit
- end
-
- if dhQst_Finished[$.questName] = False:
- $scr_Layout = 'dhScr_Def'
- IF (.clearScreen = True): func('Screen', 'ClearAll') else func('Screen', 'Clear', 'actions')
-
- KILLVAR '$dhDyn'
- gs 'DH_Quest_<<$.questName>>', $.subQuest
- gs 'DH_QuestManager', 'UpdateStoryCard'
- else
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName)
- msg($RESULT)
- exit
- end
- end
- if $ARGS[0] = 'Complete':
- $.questName = $ARGS[1]
-
- !! Check if quest exists
- if ARRPOS('$DhQst_List_', $.questName) = -1:
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName)
- exit
- end
-
- if dhQst_Finished[$.questName] = False:
- dhQst_Started[$.questName] = True
- !! $scr_Theme = 'dhScr_Def'
- !! Not sure if this should just set the quest complete or go to the complete screen?
- gt 'DH_Quest_<<$.questName>>', 'Complete'
- else
- $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName)
- exit
- end
- end
- if $ARGS[0] = 'ProgressAct':
- $.actionText = $ARGS[1]
- $.questName = $ARGS[2]
- $.subQuest = $ARGS[3]
- $.textColor = $ARGS[4]
-
- func('write', 'actions', '<a class="action" href="exec:gs ''DH_QuestManager'', ''GoTo'', ''<<$.questName>>'', ''<<$.subQuest>>''" draggable="false">')
- func('write', 'actions', $.actionText, $.textColor)
- func('writeL', 'actions', '</a>')
- func('Screen', 'Update')
- end
- if $ARGS[0] = 'DynamicAct':
- $.actionText = $ARGS[1]
- $.dynamicId = $ARGS[2]
- $.textColor = $ARGS[3]
-
- func('write', 'actions', '<a class="action" href="exec:DYNAMIC $dhDyn[''<<$.dynamicId>>'']" draggable="false">')
- func('write', 'actions', $.actionText, $.textColor)
- func('writeL', 'actions', '</a>')
- func('Screen', 'Update')
- end
- --- DH_QuestManager ---------------------------------
|