Skip to content

Commit

Permalink
Merge pull request #88 from jonathan-robertson/dev
Browse files Browse the repository at this point in the history
Trader Treatment/Therapy, State Rollback, Level Penalty, Forget Crafting, Support A21
  • Loading branch information
jonathan-robertson authored Jun 25, 2023
2 parents 0871ea3 + f309638 commit a20cbf1
Show file tree
Hide file tree
Showing 46 changed files with 2,000 additions and 451 deletions.
Binary file modified Amnesia.dll
Binary file not shown.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2023-06-25

- add console command to view skill tracker
- add cost options for memory services
- add custom dialog box for shop confirmations
- add dialog purchasing system for therapy
- replaces `Grandpa's Fergit'n Elixir`
- add dialog purchasing system for treatments
- replaces `Trader Jen's Memory Boosters`
- add `ForgetCrafting` config option
- support for A21's crafting skill reset
- add journal entry on login
- add `LevelPenalty` config option
- instead of resetting to a target level, optionally lose a fixed number of levels
- add player skill/perk tracking
- memory loss no longer unassigns skill points that were retained
- fix positive outlook xp time format
- the way this worked had changed in A21
- improve admin console feedback on update
- remove deprecated buffs
- remove forgetting elixir from loot and traders
- remove memory pills
- update buff descriptions to reflect new system
- update journal to reflect new system
- update service prices on login and level-up
- update to a21 mod-info file format
- update to a21 references

## [1.2.1] - 2023-06-04

- add admin command to give/heal fragile memory
Expand Down
19 changes: 8 additions & 11 deletions Config/Localization.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
Key,File,Type,english

amnesiaJournalTip,Journal Tip,,"Survivors are reporting strange occurrences of Amnesia when experiencing severe trauma... At level [007fff]{cvar(amnesiaLongTermMemoryLevel)}[-] and beyond, becoming incapacitated will result in a [ff8000]Fragile Memory[-]. This [ff8000]Fragile Memory[-] will cause full-blown [ff007f]Memory Loss[-] if you were to become incapacitated once more.\n\n[ff8000]This Happens Every Time I Die?[-]\nDying will impact memory, but there are a few exceptions: if [00ff80]another player kills you[-], or if [00ff80]you die during Blood Moon for any reason[-].\n\n[ff8000]What Would I Forget Due to Memory Loss?[-]\nYou will forget your level, learned skills, and unspent skill points (you'll be reset back to level [007fff]{cvar(amnesiaLongTermMemoryLevel)}[-] and can reallocate the skillpoints you would've had at that level).\n\n[ff8000]Will I Remember Anything After Memory Loss?[-]\nYou will never forget schematics, books, items/equipment (backpack is dropped on ground, but not deleted), vehicles, map, waypoints, land claims, bedroll location, quests, trader relationships.\n\n[ff8000]How Can I Recover From a Fragile Memory?[-]\nYou'll find that all traders sell a new item called [007fff]Trader Jen's Memory Boosters[-] in limited quantities, which you can use to recover from a [ff8000]Fragile Memory[-]. This will give you a buffer against memory loss, but the sale price is also quite high; you probably won't be able to afford it right away.\n\n[ff8000]Anything Else I Should Know?[-]\nDefeating certain powerful zombies will lift your spirits, providing a timed boost of double xp for you and everyone else on the server! Try to take these challenging enemies down for the benefit and relief of the entire community."
amnesiaJournalTip_title,Journal Tip,,"Amnesia [ff8000][MOD]"
amnesiaJournalTip00,Journal Tip,,"Survivors are reporting strange occurrences of Amnesia when experiencing severe trauma...\nAt [007fff]Level {cvar(amnesiaLongTermMemoryLevel)}[-] and beyond, becoming incapacitated will result in a [ff8000]Fragile Memory[-]. Becoming incapacitated with a [ff8000]Fragile Memory[-] will cause [ff007f]Memory Loss[-] and rewind progress {cvar(amnesiaLevelPenalty:by [007fff]# Levels[-] or as far back as; ;back to)} {cvar(amnesiaLongTermMemoryLevel:[007fff]Level #[-])}.\n\n[ff8000]This Happens Every Time I Die?[-]\nDying will impact memory, but there are a few exceptions: if [00ff80]another player kills you[-], or if [00ff80]you die during Blood Moon for any reason[-].\n\n[ff8000]What Would I Forget Due to Memory Loss?[-]\nApart from level and learned skills, any unspent skill points that you wouldn't otherwise have at your reduced level will be reclaimed.\n\n[ff8000]Will I Remember Anything After Memory Loss?[-]\nYou will never forget schematics, books, crafting level, items/equipment (backpack is dropped on ground, but not deleted), vehicles, map, waypoints, land claims, bedroll, quests, or trader relationships.\n\n[ff8000]How Can I Recover From a Fragile Memory?[-]\nTraders now offer a few new services related to memory; requesting [007fff]Treatment[-] will restore your fragile memory to what it once was... just keep in mind that the cost of memory services is based on your level, so try to get your memory restored quickly!\n\n[ff8000]Anything Else I Should Know?[-]\nDefeating certain powerful zombies will lift your spirits, providing a timed boost of double xp for you and everyone else on the server! Try to take these challenging enemies down for the benefit and relief of the entire community."
amnesiaJournalTip00_title,Journal Tip,,"Amnesia [ff8000][MOD]"

buffNewbieCoatDesc,buffs,Buff,"There is no XP penalty on death.\n\nThis protection will eventually disappear, so plan ahead."
buffNewbieCoatName,buffs,Buff,"Death XP Penalty Protection"

buffAmnesiaFragileMemoryName,buffs,Buffs,"Fragile Memory"
buffAmnesiaFragileMemoryDesc,buffs,Buffs,"You now have a [ff8000]Fragile Memory[-] due to being incapacitated. \n\nIf you become incapacitated again, you will experience [ff007f]Memory Loss[-].\n\n[007fff]Trader Jen's Memory Boosters[-] can be purchased from any trader to cure your [ff8000]Fragile Memory[-], which will provide a buffer against [ff007f]Memory Loss[-]."
buffAmnesiaFragileMemoryDesc,buffs,Buffs,"You now have a [ff8000]Fragile Memory[-] due to being incapacitated. \n\nIf you become incapacitated again, you will experience [ff007f]Memory Loss[-].\n\nSeek out [007fff]Treatment[-] services offered by any Trader to cure your [ff8000]Fragile Memory[-]. The cost of these services increases with your level, so try to get this taken care of as soon as possible."
buffAmnesiaFragileMemoryStartTooltip,buffs,Buffs,"You now have a [ff8000]Fragile Memory[-] due to being incapacitated"
buffAmnesiaFragileMemoryRemoveTooltip,buffs,Buffs,"You no longer have a [ff8000]Fragile Memory[-], thanks to [007fff]Trader Jen's Memory Boosters[-]"

buffAmnesiaHardenedMemoryRemoveTooltip,buffs,Buffs,"[007fff]Memory Boosters[-] you previously used [00ff80]are being given back to you[-]; see Amnesia entry in [ff8000]Journal[-] for more info."

buffAmnesiaMemoryLossName,buffs,Buffs,"Memory Loss"
buffAmnesiaMemoryLossDesc,buffs,Buffs,"You feel a sense that mistakes were made, but perhaps can find a more effective method of survival this time around.\n\n[007fff]Trader Jen's Memory Boosters[-] can be purchased from any trader to cure your [ff8000]Fragile Memory[-], which will provide a buffer against [ff007f]Memory Loss[-]."
buffAmnesiaMemoryLossDesc,buffs,Buffs,"You feel a sense that mistakes were made, but perhaps can find a more effective method of survival this time around.\n\nEvery Trader can provide [007fff]Treatment[-] for a [ff8000]Fragile Memory[-]; getting that taken care of will help to provide a buffer against [ff007f]Memory Loss[-] the next time you become incapacitated."
buffAmnesiaMemoryLossTooltip,buffs,Buffs,"You experienced [ff007f]Memory Loss[-] due to being incapacitated"

buffAmnesiaPositiveOutlookName,buffs,Buffs,"Positive Outlook"
Expand All @@ -26,7 +23,7 @@ buffAmnesiaBloodmoonLifeProtectionDesc,buffs,Buffs,"You feel something in the ai
buffAmnesiaBloodmoonLifeProtectionTooltip,buffs,Buffs,"You [00ff80]CANNOT[-] lose memory if you die during this event"
buffAmnesiaBloodmoonLifeProtectionEndTooltip,buffs,Buffs,"Blood Moon Memory Protection [ff007f]HAS ENDED[-]"

drugAmnesiaMemoryBoosters,items,Medical,"Trader Jen's Memory Boosters"
drugAmnesiaMemoryBoostersDesc,items,Medical,"Ingesting this special drug/vitamin cocktail loaded with omega-3 fatty acids will stabilize a [ff8000]Fragile Memory[-].\n\n[007fff]Don't Forget, Get BOOSTED![-]\n - Trader Jen's Experimental Pharmaceuticals"

statStopsFragileMemory,ui_display,Item stat,"Cure Fragile Memory"
dialog_trader_response_memory,Quest,Dialogs,"Can you help with my memory?"
dialog_trader_statement_memory,Quest,Dialogs,"Sure, what can I do for you? ([decea3]Listed prices are based on your level[-])"
dialog_trader_response_treatment,Quest,Dialogs,"Treatment: Please treat my fragile memory. ([decea3]${cvar(amnesiaTreatmentPrice)}[-])"
dialog_trader_response_therapy,Quest,Dialogs,"Therapy: Please help me rethink my skills. ([decea3]${cvar(amnesiaTherapyPrice)}[-])"
27 changes: 27 additions & 0 deletions Config/XUi/controls.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<config>
<append xpath="/controls">
<tip_header text="">
<panel name="header" height="43" depth="1" backgroundspritename="ui_game_panel_header">
<sprite depth="2" name="windowIcon" style="icon32px" pos="4,-5" sprite="ui_game_symbol_intellect" />
<label style="header.name" text="${text}" width="550" />
</panel>
</tip_header>
<tip_body text="">
<rect name="content" pos="0,-46" height="319" depth="1" pivot="center">
<sprite depth="8" name="backgroundMain" sprite="menu_empty3px" pos="0,0" width="603" color="[black]" type="sliced" fillcenter="false" />
<sprite color="[darkGrey]" type="sliced" />
<label depth="3" name="descriptionText" pos="8,-8" text="${text}" width="590" height="265" font_size="30" />

<rect name="btnContinue" depth="3" pos="0, -277" height="42">
<sprite depth="8" name="backgroundMain" sprite="menu_empty3px" color="[black]" type="sliced" fillcenter="false" />
<sprite depth="2" name="background" pos="3,-3" sprite="menu_empty" width="224" height="32" color="[darkGrey]" type="sliced" />
<rect depth="3" pos="0,0" height="42">
<button name="clickable" sprite="menu_empty" defaultcolor="[mediumGrey]" hoversprite="ui_game_select_row" hovercolor="[white]" type="sliced" hoverscale="1.0" />

<label depth="2" name="windowName" pos="0,-1" justify="center" text="CONTINUE" text_key="btnContinue" font_size="36" />
</rect>
</rect>
</rect>
</tip_body>
</append>
</config>
20 changes: 20 additions & 0 deletions Config/XUi/windows.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<config>
<append xpath="/windows">
<window name="amnesiaDialogShopCannotAfford" width="603" height="363" pos="-300, 150" controller="TipWindow" anchor="CenterCenter" pivot="center" depth="15" cursor_area="true">
<tip_header text="Memory Services" />
<tip_body text="You [decea3]do not have the necessary funds[-] for this procedure. Please return when you do." />
</window>
<window name="amnesiaDialogShopTreatmentUnnecessary" width="603" height="363" pos="-300, 150" controller="TipWindow" anchor="CenterCenter" pivot="center" depth="15" cursor_area="true">
<tip_header text="Memory Treatment" />
<tip_body text="You have no need of Treatment since [decea3]your memory is already healthy[-]. Please come again if you need these services in the future." />
</window>
<window name="amnesiaDialogShopTreatmentComplete" width="603" height="363" pos="-300, 150" controller="TipWindow" anchor="CenterCenter" pivot="center" depth="15" cursor_area="true">
<tip_header text="Memory Treatment" />
<tip_body text="Your treatment is now complete and [00ff80]your memory has returned to a health state[-]. Please come again!" />
</window>
<window name="amnesiaDialogShopTherapyComplete" width="603" height="363" pos="-300, 150" controller="TipWindow" anchor="CenterCenter" pivot="center" depth="15" cursor_area="true">
<tip_header text="Memory Treatment" />
<tip_body text="Your therapy is now complete and [00ff80]your skill points can be reassigned[-]. Please come again!" />
</window>
</append>
</config>
16 changes: 16 additions & 0 deletions Config/XUi/xui.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<config>
<append xpath="/xui/ruleset">
<window_group name="amnesiaDialogShopCannotAffordWindowGroup">
<window name="amnesiaDialogShopCannotAfford" />
</window_group>
<window_group name="amnesiaDialogShopTreatmentUnnecessaryWindowGroup">
<window name="amnesiaDialogShopTreatmentUnnecessary" />
</window_group>
<window_group name="amnesiaDialogShopTreatmentCompleteWindowGroup">
<window name="amnesiaDialogShopTreatmentComplete" />
</window_group>
<window_group name="amnesiaDialogShopTherapyCompleteWindowGroup">
<window name="amnesiaDialogShopTherapyComplete" />
</window_group>
</append>
</config>
42 changes: 29 additions & 13 deletions Config/buffs.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
<config>
<append xpath="/buffs/buff[@name='buffStatusCheck02']">
<effect_group name="amnesiaJournalEntries">
<triggered_effect trigger="onSelfEnteredGame" action="AddJournalEntry" journal="amnesiaJournalTip" />
<triggered_effect trigger="onSelfEnteredGame" action="AddJournalEntry" journal="amnesiaJournalTip00" />
</effect_group>
</append>


<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group/requirement[@name='PlayerLevel']/@value">@amnesiaLongTermMemoryLevel</set>
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group/triggered_effect/requirement[@name='PlayerLevel']/@value">@amnesiaLongTermMemoryLevel</set>

<append xpath="/buffs">
<!-- TODO: remove for 2.0.0 - deprecated: keeping around until then for backwards compatibility -->
<buff name="buffAmnesiaHardenedMemory" remove_on_death="false" hidden="true">
<duration value="0" />
<stack_type value="ignore" />
<effect_group>
<triggered_effect trigger="onSelfBuffRemove" action="ShowToolbeltMessage" message_key="buffAmnesiaHardenedMemoryRemoveTooltip" />
</effect_group>
</buff>

<buff name="buffAmnesiaFragileMemory" name_key="buffAmnesiaFragileMemoryName" description_key="buffAmnesiaFragileMemoryDesc" icon="ui_game_symbol_intellect" icon_color="255,128,0" remove_on_death="false">
<duration value="0" />
<stack_type value="ignore" />
Expand All @@ -27,7 +17,6 @@

<effect_group>
<triggered_effect trigger="onSelfBuffStart" action="ShowToolbeltMessage" message_key="buffAmnesiaFragileMemoryStartTooltip" />
<triggered_effect trigger="onSelfBuffRemove" action="ShowToolbeltMessage" message_key="buffAmnesiaFragileMemoryRemoveTooltip" />
<passive_effect name="BuffBlink" operation="base_set" value="2" duration="0,3" tags="buffAmnesiaFragileMemory" />
</effect_group>
</buff>
Expand All @@ -52,7 +41,7 @@

<buff name="buffAmnesiaPositiveOutlook" name_key="buffAmnesiaPositiveOutlookName" description_key="buffAmnesiaPositiveOutlookDesc" icon="ui_game_symbol_xp" icon_color="0,255,128" remove_on_death="false">
<duration value="0" />
<display_value value="amnesiaPositiveOutlookRemTime" />
<display_value value="$amnesiaPositiveOutlookRemTime" />
<display_value_format value="time" />

<effect_group name="activeEffects">
Expand All @@ -62,12 +51,14 @@
</effect_group>
<effect_group name="update">
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="amnesiaPositiveOutlookRemTime" operation="subtract" value="1" />
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$amnesiaPositiveOutlookRemTime" operation="set" value="@amnesiaPositiveOutlookRemTime" />
<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffAmnesiaPositiveOutlook">
<requirement name="CVarCompare" cvar="amnesiaPositiveOutlookRemTime" operation="LTE" value="0" />
</triggered_effect>
</effect_group>
<effect_group name="cleanup">
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar="amnesiaPositiveOutlookRemTime" operation="set" value="0" />
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar="$amnesiaPositiveOutlookRemTime" operation="set" value="0" />
</effect_group>
</buff>

Expand Down Expand Up @@ -107,6 +98,31 @@
<triggered_effect trigger="onSelfBuffRemove" action="ShowToolbeltMessage" message_key="buffAmnesiaBloodmoonLifeProtectionEndTooltip" />
</effect_group>
</buff>

<buff name="buffAmnesiaTryBuyTreatment" hidden="true" remove_on_death="false">
<stack_type value="ignore" />
<duration value="0" />
<!-- wait for server to process and remove this, along with buffAmnesiaFragileMemory -->
<effect_group>
<triggered_effect trigger="onSelfEnteredGame" action="RemoveBuff" buff="buffAmnesiaTryBuyTreatment" />
</effect_group>
</buff>
<buff name="buffAmnesiaTryBuyTherapy" hidden="true" remove_on_death="false">
<stack_type value="ignore" />
<duration value="0" />
<!-- wait for server to process and remove this -->
<effect_group>
<triggered_effect trigger="onSelfEnteredGame" action="RemoveBuff" buff="buffAmnesiaTryBuyTherapy" />
</effect_group>
</buff>
<buff name="buffAmnesiaRequestChangeCallback" hidden="true" remove_on_death="false">
<stack_type value="ignore" />
<duration value="0" />
<!-- wait for server to process and remove this, along with buffAmnesiaFragileMemory -->
<effect_group>
<triggered_effect trigger="onSelfEnteredGame" action="RemoveBuff" buff="buffAmnesiaRequestChangeCallback" />
</effect_group>
</buff>
</append>
<!-- TODO: explore how onCombatEntered works: perhaps a screen effect could be added when on last life onCombatEntered as a reminder -->
</config>
23 changes: 23 additions & 0 deletions Config/dialogs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<config>
<insertBefore xpath="/dialogs/dialog[@id='trader' or @id='traderTest']/statement[@id='start']/response_entry[@id='admin']">
<response_entry id="memory" />
</insertBefore>

<append xpath="/dialogs/dialog[@id='trader' or @id='traderTest']">
<response id="memory" text="dialog_trader_response_memory" nextstatementid="memory" />

<statement id="memory" text="dialog_trader_statement_memory">
<response_entry id="treatment" />
<response_entry id="therapy" />
<response_entry id="nevermind" />
</statement>

<response id="treatment" text="dialog_trader_response_treatment">
<action type="AddBuff" id="buffAmnesiaTryBuyTreatment" />
</response>

<response id="therapy" text="dialog_trader_response_therapy">
<action type="AddBuff" id="buffAmnesiaTryBuyTherapy" />
</response>
</append>
</config>
Loading

0 comments on commit a20cbf1

Please sign in to comment.