Browse Source

Working sausage mission timers, backstab highlights

pull/2/head
Brandon Cornejo 6 years ago
parent
commit
09296dc48d
  1. 4
      config.tin
  2. 26
      src/combat.tin
  3. 56
      src/missions.tin
  4. 111
      src/missions/sausages.tin
  5. 24
      src/missiontimers.tin
  6. 116
      src/missiontimers/letters.tin
  7. 56
      src/missiontimers/sausage_lite.tin
  8. 79
      src/missiontimers/sausages.tin

4
config.tin

@ -22,10 +22,10 @@
#READ {src/combat.tin}; #READ {src/combat.tin};
#READ {src/deadletter.tin}; #READ {src/deadletter.tin};
#READ {src/quow.tin};
#READ {src/db.tin};
#READ {src/magic.tin}; #READ {src/magic.tin};
#READ {src/missiontimers.tin};
#READ {src/missions.tin};
#SESSION {discworld} {discworld.starturtle.net} {4242}; #SESSION {discworld} {discworld.starturtle.net} {4242};

26
src/combat.tin

@ -4,14 +4,6 @@
#VARIABLE {my_attacks_color} {orange}; #VARIABLE {my_attacks_color} {orange};
#VARIABLE {enemy_attack_color} {red}; #VARIABLE {enemy_attack_color} {red};
#NOP ==[Me Attacking Them]==
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}{thrust|snick|fillet|poke|chop up|chop|jab|scratch|boot|kick|hit|tickle|hack|prick|shred|nick|cut|stab|perforate|pierce|impale|slice|skewer|take} {a sliver off |into |}%1{'?s?} %2 {on|with} %3} {$my_attacks_color};
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}stab %1 {deeply |}in %2 with %3} {$my_attacks_color};
#HIGHLIGHT {^You stab %1 right through %2's %3} {$my_attacks_color};
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}{poke|kick|punch|jab|boot|tickle|kick out} %1 in %2} {$my_attacks_color};
#HIGHLIGHT {^You {punch|kick out} at %1 but {his|her} %2 absorbs {some|most} of the blow\.$} {$my_attacks_color};
#NOP ==[My Specials]== #NOP ==[My Specials]==
#HIGHLIGHT {^You attempt to prepare %1} {bold red}; #HIGHLIGHT {^You attempt to prepare %1} {bold red};
#HIGHLIGHT {^You prepare to {stab|slice|trip|shove|impale|kick|punch} %2} {bold green}; #HIGHLIGHT {^You prepare to {stab|slice|trip|shove|impale|kick|punch} %2} {bold green};
@ -22,9 +14,25 @@
#HIGHLIGHT {^You shove %1} {bold green}; #HIGHLIGHT {^You shove %1} {bold green};
#HIGHLIGHT {^You trip %1} {bold green}; #HIGHLIGHT {^You trip %1} {bold green};
#HIGHLIGHT {^You lose the moment.} {bold red}; #HIGHLIGHT {^You lose the moment.} {bold red};
#HIGHLIGHT {^You {skillfully |silently|}sneak around %1 without being spotted and manage to catch %w by surprise.$} {bold green};
#NOP ==[Backstabs]==
#HIGHLIGHT {^You {skilfully |silently |}sneak around %1 without being spotted and manage to %2.$} {bold green};
#HIGHLIGHT {^You hold your cover as you {skillfully |silently |}sneak around %1 and manage to catch %w by surprise.$} {bold green}; #HIGHLIGHT {^You hold your cover as you {skillfully |silently |}sneak around %1 and manage to catch %w by surprise.$} {bold green};
#HIGHLIGHT {^You %1 with %2 but despite the surprise %3.$} {bold red} {2};
#HIGHLIGHT {^Moving {swiftly|quickly|too fast to see}, you %1 {with|right through} %2.$} {bold green};
#HIGHLIGHT {^Catching %w {by surprise|off balance}, you %1 {with|right through} %2.$} {bold green};
#HIGHLIGHT {^With {a blur of speed|surprising speed}, you %1 {with|right through} %2.$} {bold green};
#HIGHLIGHT {^Quick as lightning, you %1 {with|right through} %2.$} {bold green};
#HIGHLIGHT {Striking like a cobra, you %1 {with|right through} %2.$} {bold green};
#NOP ==[Me Attacking Them]==
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}{thrust|snick|fillet|poke|chop up|chop|jab|scratch|boot|kick|hit|tickle|hack|prick|shred|nick|cut|stab|perforate|pierce|impale|slice|skewer|take} {a sliver off |into |}%1{'?s?} %2 {on|with} %3} {$my_attacks_color};
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}stab %1 {deeply |}in %2 with %3} {$my_attacks_color};
#HIGHLIGHT {^You stab %1 right through %2's %3} {$my_attacks_color};
#HIGHLIGHT {^You {viciously |messily |barely |neatly |}{poke|kick|punch|jab|boot|tickle|kick out} %1 in %2} {$my_attacks_color};
#HIGHLIGHT {^You {punch|kick out} at %1 but {his|her} %2 absorbs {some|most} of the blow\.$} {$my_attacks_color};
#NOP == [Them Attacking Me]== #NOP == [Them Attacking Me]==

56
src/missions.tin

@ -0,0 +1,56 @@
#CLASS {missiontimers} {kill};
#CLASS {missiontimers} {open};
#NOP ==[ Load Sausage Mission stuff ]==
#READ {src/missions/sausages.tin};
#ALIAS {missions} {
#if {&missions} {
#echo {<149>[MT] Active Mission Timers:<099>};
} { #return; };
#format {current_time} {%T};
#var {mission_display_list} {};
#if {&missions[sausage]} {
#foreach {$missions[sausage][active_list][]} {player} {
#if {&missions[sausage][active_list][$player][easy]} {
#math {mins} { (($current_time - $missions[sausage][active_list][$player][easy]) + 0.5) / 60 };
#math {mins} {60 - $mins};
#format {mt_display} {\t<129>%s<099> can do another unspiced sausage mission in <139>%d<099> minutes.<099>} {$player}{$mins};
#list {mission_display_list[$player]} {add} {$mt_display};
};
#if {&missions[sausage][active_list][$player][hard]} {
#math {mins} { (($current_time - $missions[sausage][active_list][$player][hard]) + 0.5) / 60 };
#math {mins} {60 - $mins};
#format {mt_display} {\t<129>%s<099> can do another spiced sausage mission in <139>%d<099> minutes.<099>} {$player}{$mins};
#list {mission_display_list[$player]} {add} {$mt_display};
};
};
#foreach {$missions[sausage][retry_list][]} {player} {
#math {mins} { (($current_time - $missions[sausage][retry_list][$player]) + 0.5) / 60 };
#math {mins} {10 - $mins};
#format {mt_display} {\t<129>%s<099> can request a new sausage mission in <139>%d<099> minutes.<099>} {$player}{$mins};
#list {mission_display_list[$player]} {add} {$mt_display};
};
};
#nop We've compiled all of the different mission timers by-character, now print them out;
#foreach {$mission_display_list[]} {player} {
#foreach {$mission_display_list[$player][%*]} {mt_display} {
#showme {$mt_display};
};
};
};
#nop "#event {RECEIVED OUTPUT} {%0}" catches all the things.... one event trigger
#nop and process a bunch of stuff?
#CLASS {missiontimers} {close};

111
src/missions/sausages.tin

@ -0,0 +1,111 @@
#CLASS {missiontimers_sausages} {kill};
#CLASS {missiontimers_sausages} {open};
#NOP =======================
#NOP ===== VARIABLES =====
#NOP =======================
#VARIABLE {missions[sausage]} {
{current_difficulty}{1}
{current_primer}{1}
}
#NOP =======================
#NOP ===== Aliases =====
#NOP =======================
#ALIAS {/sd_prep} {
#send {frimble Sam Slager asks you: So, you want to try filling a sausage order? You'll have four hours to hunt a lobster, gather spices};
};
#ALIAS {/sd_start} {
#send {frimble You have four hours to deliver 100 fresh pepper lobster sausages to Sam Slager.};
};
#ALIAS {/sd_resign} {
#send {frimble Sam Slager says to you: I'll have to take care of this one later.};
};
#ALIAS {/sd_complete} {
#send {frimble Sam Slager gives you 5 Ankh-Morpork ten-dollars, 9 Ankh-Morpork dollars, one Ankh-Morpork half-dollar and 5 Ankh-Morpork pence.};
};
#ALIAS {/sausage_mission_end} {
#unaction {You have four hours to deliver %%1 fresh %%2 sausages to Sam Slager.$};
#unaction {Sam Slager says to you: I'll have to take care of this one later.$};
#unaction {Sam Slager gives you %%1{dollar|pence}%%3$};
};
#ALIAS {/sausage_mission_start} {
#unaction {You have four hours to deliver %%1 fresh %%2 sausages to Sam Slager.$};
#var {missions[sausage][current_difficulty]} {$missions[sausage][current_primer]};
#nop [A mission started, start checking for resignations];
#action {Sam Slager says to you: I'll have to take care of this one later.$} {
/sausage_mission_end;
#format {missions[sausage][retry_list][$GMCP[charinfo][capname]]} {%T};
#line sub variable {
#delay {600} {
#format {sausage_retry_line} {%c[MH] %c*%c %s%c can now ask for a new sausage mission from Sam Slager.} {bold blue} {bold yellow} {bold green}{$GMCP[charinfo][capname]} {bold blue};
#echo {$sausage_retry_line};
#unvar {sausage_retry_line};
#unvar {missions[sausage][retry_list][$GMCP[charinfo][capname]]};
};
};
};
#nop [A mission started, start checking for completions];
#action {Sam Slager gives you %%1{dollar|pence}%%3$} {
/sausage_mission_end;
#if {"$missions[sausage][current_difficulty]" == "1"} {
#format {missions[sausage][active_list][$GMCP[charinfo][capname]][easy]} {%T};
#line sub variable {
#format {delayname} {sausage_easy_%s} {$GMCP[charinfo][capname]};
#delay {$delayname} {
#format {sausage_timer_line} {%c[MH] %c*%c %s can now do another unspiced sausage mission.} {bold blue} {bold yellow} {bold blue} {$GMCP[charinfo][capname]};
#echo {$sausage_timer_line};
#unvar {sausage_timer_line};
#unvar {missions[sausage][active_list][$GMCP[charinfo][capname]][easy]};
} {3600};
};
#unvar {delayname};
};
#else {
#format {missions[sausage][active_list][$GMCP[charinfo][capname]][hard]} {%T};
#line sub variable {
#format {delayname} {sausage_hard_%s} {$GMCP[charinfo][capname]};
#delay {$delayname} {
#format {sausage_timer_line} {%c[MH] %c*%c %s last finished a spiced sausage mission.} {bold blue} {bold yellow} {bold blue} {$GMCP[charinfo][capname]};
#echo {$sausage_timer_line};
#unvar {sausage_timer_line};
#unvar {missions[sausage][active_list][$GMCP[charinfo][capname]][hard]};
} {3600};
};
#unvar {delayname};
};
};
};
#ALIAS {/sausage_mission_prep} {
#action {You have four hours to deliver %%1 fresh %%2 sausages to Sam Slager.$} {
/sausage_mission_start;
};
}
#NOP =======================
#NOP ===== Actions =====
#NOP =======================
#NOP ==[Sausage Missions]==
#ACTION {Sam Slager asks you: So, you want to try filling a sausage order? You'll have four hours to hunt %1, gather %2} {
#var {missions[sausage][current_primer]} {2};
/sausage_mission_prep;
};
#ACTION {Sam Slager asks you: So, you want to try filling a sausage order? You'll have four hours to hunt %1, make %2} {
#var {missions[sausage][current_primer]} {1};
/sausage_mission_prep
};
#CLASS {missiontimers_sausages} {close};

24
src/missiontimers.tin

@ -1,24 +0,0 @@
#CLASS {missiontimers} {kill};
#CLASS {missiontimers} {open};
#NOP ==[ Load Sausage Mission stuff ]==
#READ {src/missiontimers/sausage_lite.tin};
#ALIAS {missions} {
#if {&missions} { #echo {Mission Timers:}; } { #return; };
#if {&missions[sausage]} {
#foreach {$missions[sausage][active_list][%*]} {player} {
#showme {\t$player is cooling down on sausage missions.};
};
#foreach {$missions[sausage][retry_list][%*]} {player} {
#showme {\t$player is not able to request a new sausage mission.};
};
};
};
#nop "#event {RECEIVED OUTPUT} {%0}" catches all the things.... one event trigger
#nop and process a bunch of stuff?
#CLASS {missiontimers} {close};

116
src/missiontimers/letters.tin

@ -1,116 +0,0 @@
#CLASS {missiontimers_letters} {kill};
#CLASS {missiontimers_letters} {open};
#NOP [1 = Local, 2= Far Away, 3 = Distant Lands, 4 = Difficult Customer]
#VAR {dead_letter_rewards} {
{4 Ankh-Morpork dollars}{1}
{8 Ankh-Morpork dollars}{2}
{3 Djelian talents and 5 Djelian tooni}{3}
{4 Lancre crowns and 2 Lancre shillings}{3}
{7 Ephebian decadrachmae and 2 Ephebian stater}{3}
{2 Ankh-Morpork ten-dollars}{3}
{2 Genuan forins and 5 Genuan livres}{3}
{1 Klatchian ten dinar and 2 Klatchian two dinar coins}{3}
{1 Agatean Empire ten-rhinu and 5 Agatean Empire rhinu}{3}
{7 Lancre crowns and 5 Lancre shillings}{4}
{2 Agatean Empire ten-rhinu and 5 Agatean Empire rhinu}{4}
{6 Djelian talents and 5 Djelian tooni}{4}
{4 Genuan forins and 3 Genuan livres}{4}
{3 Ankh-Morpork ten-dollars and 2 Ankh-Morpork dollars}{4}
{1 Ephebian mina and 5 Ephebian decadrachmae}{4}
{1 Agatean Empire fifty-rhinu and 2 Agatean Empire ten-rhinu}{5}
{9 Ankh-Morpork ten-dollars}{5}
{1 Lancre sovereign and 1 Lancre tencrown}{5}
{3 Ephebian minae and 5 Ephebian decadrachmae}{5}
{1 Genuan ducat and 2 Genuan forins}{5}
}
#var {missions[letter][active_list]} {};
#var {missions[letter][retry_list]} {};
#ALIAS {/letter_returned} {
#list {missions[letter][retry_list]} {find} {$GMCP[charinfo][name]} {letter_current};
#if {$letter_current == 0} {
#list {missions[letter][retry_list]} {add} {$GMCP[charinfo][name]};
#line sub variable {
#delay {600} {
#nop Print message
#format {letter_retry_line} {%c[MH] %c*%c %s%c can now request a new letter from Frank.} {bold blue} {bold yellow} {bold green}{$GMCP[charinfo][name]} {bold blue};
#echo {$letter_retry_line};
#unvar {letter_retry_line};
#nop Remove player from state list
#list {missions[letter][retry_list]} {find} {$GMCP[charinfo][name]} {letter_current_inner};
#list {missions[letter][retry_list]} {delete} {$letter_current_inner};
};
};
};
#unvar {letter_current};
};
#ALIAS {return letter} {
#send {return letter};
/letter_returned;
};
#ACTION {^You offer to give a letter to Frank} {
/letter_returned;
};
#ACTION {^You have been awarded %d experience points and given %+} {
#nop You have been awarded 60407 experience points and given 2 Agatean Empire ten-rhinu and 5 Agatean Empire rhinu.
-- Last difficulty completion seen for future salute trigger
local iLastDifficultyCompleted = 0
-- Detected a reward string, record a difficulty level in preperation for the salute line
function QuowMissionReward (sName, sLine, wildcards)
sCashValue = wildcards[1]
if (sQuowRewards[sCashValue] ~= nil) then
iLastDifficultyCompleted = sQuowRewards[sCashValue]
else
-- See if we were waiting for an Ozzie pottery timer?
if (IsTimer("StoPotteryWaiting_" .. sCurrentCharacter) == 0) then
AddTimer ("StoLatPottery_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
elseif (IsTimer("OCPennieMission_" .. sCurrentCharacter) == 0) then
AddTimer ("OCPennieLaced_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
end
end
end
}
<trigger
enabled="y"
keep_evaluating="n"
match="^(?:> )?You have been awarded [0-9]{1,7} experience points and given (.+?)\.$"
regexp="y"
script="QuowMissionReward"
name="QuowMissionReward"
sequence="40"
>
</trigger>
#ACTION {^You salute smartly as you deliver a letter} {
-- Saw a successful delivery mission, start a timer if we have a known difficulty completion value
function QuowLetterSuccess (sName, sLine, wildcards)
if (bNotificationTimers ~= true) then
return
end
if (iLastDifficultyCompleted == 1) then
AddTimer ("DeadLetterLocal_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
elseif (iLastDifficultyCompleted == 2) then
AddTimer ("DeadLetterCloseby_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
elseif (iLastDifficultyCompleted == 3) then
AddTimer ("DeadLetterFaraway_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
elseif (iLastDifficultyCompleted == 4) then
AddTimer ("DeadLetterDistant_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
elseif (iLastDifficultyCompleted == 5) then
AddTimer ("DeadLetterDifficult_" .. sCurrentCharacter, 1, 0, 0, "", 1061, "QuowMissionNotify")
end
iLastDifficultyCompleted = 0
end
};
#CLASS {missiontimers_letters} {close};

56
src/missiontimers/sausage_lite.tin

@ -1,56 +0,0 @@
#CLASS {missiontimers_sausages} {kill};
#CLASS {missiontimers_sausages} {open};
#var {missions[sausage][active_list]} {};
#var {missions[sausage][retry_list]} {};
#nop You have four hours to deliver 150 fresh - line to start it all?
#ACTION {^You have four hours to deliver %d fresh} {
#action {^Sam Slager says to%+you: I'll have to take care of this one later} {
#nop [A mission started, start checking for resignations];
#nop Are we already waiting on a timer for this character?
#list {missions[sausage][retry_list]} {find} {$GMCP[charinfo][name]} {sausage_current};
#if {$sausage_current == 0} {
#list {missions[sausage][retry_list]} {add} {$GMCP[charinfo][name]};
#line sub variable {
#delay {600} {
#nop Print message
#format {sausage_retry_line} {%c[MH] %c*%c %s%c can now try a new sausage mission from Sam Slager.} {bold blue} {bold yellow} {bold green}{$GMCP[charinfo][name]} {bold blue};
#echo {$sausage_retry_line};
#unvar {sausage_retry_line};
#nop Remove player from state list
#list {missions[sausage][retry_list]} {find} {$GMCP[charinfo][name]} {sausage_current_inner};
#list {missions[sausage][retry_list]} {delete} {$sausage_current_inner};
};
};
};
#unvar {sausage_current};
};
#action {^Sam Slager says to%+you: Thank you, that's all} {
#nop [A mission started, start checking for completions];
#nop Are we already waiting on a timer for this character?
#list {missions[sausage][active_list]} {find} {$GMCP[charinfo][name]} {sausage_current};
#if {$sausage_current == 0} {
#list {missions[sausage][active_list]} {add} {$GMCP[charinfo][name]};
#line sub variable {
#delay {3600} {
#nop Print message
#format {sausage_timer_line} {%c[MH] %c*%c %s can get full XP for a sausage mission.} {bold blue} {bold yellow} {bold blue} {$GMCP[charinfo][name]};
#echo {$sausage_timer_line};
#unvar {sausage_timer_line};
#nop Remove player from state list
#list {missions[sausage][active_list]} {find} {$GMCP[charinfo][name]} {sausage_current_inner};
#list {missions[sausage][active_list]} {delete} {$sausage_current_inner};
};
};
};
#unvar {sausage_current};
};
};
#CLASS {missiontimers_sausages} {close};

79
src/missiontimers/sausages.tin

@ -1,79 +0,0 @@
#CLASS {missiontimers_sausages} {kill};
#CLASS {missiontimers_sausages} {open};
#NOP =======================
#NOP ===== VARIABLES =====
#NOP =======================
#VARIABLE {missions[sausage]} {
{current_difficulty}{1}
{current_primer}{1}
}
#NOP =======================
#NOP ===== Aliases =====
#NOP =======================
#ALIAS {/sausage_mission_start} {
#unaction {^You have four hours to deliver %1 fresh %2 sausages to Sam Slager.$};
#var {missions[sausage][current_difficulty]} {$missions[sausage][current_primer]};
#nop [A mission started, start checking for resignations]
#action {^Sam Slager says to %1 I'll have to take care of this one later.$} {
#unaction {^You have four hours to deliver %1 fresh %2 sausages to Sam Slager.$};
#unaction {^Sam Slager says to %1 I'll have to take care of this one later.$};
#unaction {^Sam Slager gives you %1{dollar|pence}%3$};
#line sub variable {
#delay {600} {
#format {sausage_retry_line} {%c[MH] %c*%c %s%c can now try a new sausage mission from Sam Slager.} {bold blue} {bold yellow} {bold green}{$GMCP[charinfo][name]} {bold blue};
#echo {$sausage_retry_line};
#unvar {sausage_retry_line};
};
};
};
#nop [A mission started, start checking for completions]
#action {^Sam Slager gives you %1{dollar|pence}%3$} {
#unaction {^You have four hours to deliver %1 fresh %2 sausages to Sam Slager.$};
#unaction {^Sam Slager says to %1 I'll have to take care of this one later.$};
#unaction {^Sam Slager gives you %1{dollar|pence}%3$};
#if {$missions[sausage][current_difficulty]} {
#format {delayname} {sausage_easy_%s} {$GMCP[charinfo][name]};
#line sub variable {
#delay {$delayname} {
#format {sausage_timer_line} {%c[MH] %c*%c %s last finished an unspiced sausage mission.} {bold blue} {bold yellow} {bold blue} {$GMCP[charinfo][name]};
#echo {$sausage_timer_line};
#unvar {sausage_timer_line};
} {3600};
};
#unvar {delayname};
};
#else {
#line sub variable {
#format {delayname} {sausage_hard_%s} {$GMCP[charinfo][name]};
#delay {$delayname} {
#format {sausage_timer_line} {%c[MH] %c*%c %s last finished a spiced sausage mission.} {bold blue} {bold yellow} {bold blue} {$GMCP[charinfo][name]};
#echo {$sausage_timer_line};
#unvar {sausage_timer_line};
} {3600};
};
#unvar {delayname};
};
};
};
#NOP =======================
#NOP ===== Actions =====
#NOP =======================
#NOP ==[Sausage Missions]==
#ACTION {^Sam Slager asks you: So, you want to try filling a sausage order? You'll have four hours to hunt %1, gather spices to mix into the ground meat, make %2 sausages from it, and deliver them to me. Are you up to it?$} {
#var {missions[sausage][current_primer]} {2};
#action {^You have four hours to deliver %1 fresh %2 sausages to Sam Slager.$} { /sausage_mission_start; };
};
#ACTION {^Sam Slager asks you: So, you want to try filling a sausage order? You'll have four hours to hunt %1, make %2 sausages from it, and deliver them to me. Are you up to it?$} {
#var {missions[sausage][current_primer]} {1};
#action {^You have four hours to deliver %1 fresh %2 sausages to Sam Slager.$} { /sausage_mission_start; };
};
#CLASS {missiontimers_sausages} {close};
Loading…
Cancel
Save