Browse Source

new ending stuff, a bunch of other changes

master
Alison Watson 11 months ago
parent
commit
1e7601e0f6
56 changed files with 1436 additions and 618 deletions
  1. BIN
      pk7/acs/lithmain.bin
  2. +11
    -0
      pk7/language.gfx.txt
  3. +21
    -5
      pk7/language.txt
  4. +25
    -12
      pk7/lfiles/End_Barons.txt
  5. +22
    -19
      pk7/lfiles/End_Common.txt
  6. +25
    -12
      pk7/lfiles/End_CyberDemon.txt
  7. +20
    -0
      pk7/lfiles/End_Division.txt
  8. +39
    -12
      pk7/lfiles/End_IconOfSin.txt
  9. +25
    -10
      pk7/lfiles/End_Normal.txt
  10. +25
    -0
      pk7/lfiles/End_Other.txt
  11. +25
    -12
      pk7/lfiles/End_SpiderDemon.txt
  12. +24
    -13
      pk7/lfiles/End_TimeOut.txt
  13. BIN
      pk7/lgfx/End/Jem/Barons.png
  14. BIN
      pk7/lgfx/End/Jem/CyberDemon.png
  15. BIN
      pk7/lgfx/End/Jem/Normal.png
  16. BIN
      pk7/lgfx/End/Jem/Other.png
  17. BIN
      pk7/lgfx/End/Jem/SpiderDemon.png
  18. BIN
      pk7/lgfx/End/Stan/Barons.png
  19. BIN
      pk7/lgfx/End/Stan/CyberDemon.png
  20. BIN
      pk7/lgfx/End/Stan/Normal.png
  21. BIN
      pk7/lgfx/End/Stan/Other.png
  22. BIN
      pk7/lgfx/End/Stan/SpiderDemon.png
  23. BIN
      pk7/lgfx/End/TimeOut.png
  24. BIN
      pk7/lmusic/siarani.ogg
  25. +0
    -1
      pk7/lzscript/Playsim.zsc
  26. +0
    -253
      pk7/lzscript/Playsim/EndSeq.zsc
  27. +86
    -39
      pk7/lzscript/Playsim/Events.zsc
  28. +7
    -0
      pk7/lzscript/Playsim/World.zsc
  29. +1
    -0
      pk7/mapinfo.txt
  30. +2
    -2
      pk7_ep1/mapinfo.txt
  31. +12
    -14
      source/d_compile.c
  32. +4
    -4
      source/d_cutil.c
  33. +18
    -26
      source/d_stmt.c
  34. +5
    -5
      source/d_stmt_asm.c
  35. +16
    -0
      source/debug.c
  36. +1
    -0
      source/include/common.h
  37. +0
    -37
      source/include/d_compile.h
  38. +0
    -3
      source/include/m_file.h
  39. +21
    -8
      source/include/m_tokbuf.h
  40. +3
    -5
      source/include/m_token.h
  41. +5
    -5
      source/include/p_savedata.h
  42. +3
    -0
      source/include/w_world.h
  43. +37
    -58
      source/m_file.c
  44. +68
    -7
      source/m_tokbuf.c
  45. +81
    -1
      source/m_token.c
  46. +2
    -3
      source/p_bip.c
  47. +354
    -0
      source/w_finale.c
  48. +6
    -27
      source/w_world.c
  49. +21
    -17
      text/en/End/Credits.txt
  50. +3
    -0
      text/en/End/Dedication.txt
  51. +28
    -0
      text/en/End/Division.txt
  52. +207
    -2
      text/en/End/Jem/IconOfSin.txt
  53. +178
    -1
      text/en/End/Stan/IconOfSin.txt
  54. +1
    -1
      text/en/End/TimeOut1.txt
  55. +1
    -1
      text/en/End/TimeOut2.txt
  56. +3
    -3
      tools/upgc.rb

BIN
pk7/acs/lithmain.bin View File


+ 11
- 0
pk7/language.gfx.txt View File

@@ -43,8 +43,19 @@ identifier,default
:Dialogue:SelectBack,lgfx/Dialogue/SelectBack.png
:Dialogue:SelectBackHot,lgfx/Dialogue/SelectBackHot.png
:Dialogue:Selection,lgfx/Dialogue/Selection.png
:End:Jem:Barons,lgfx/End/Jem/Barons.png
:End:Jem:CyberDemon,lgfx/End/Jem/CyberDemon.png
:End:Jem:IconOfSin,lgfx/End/Jem/IconOfSin.png
:End:Jem:Normal,lgfx/End/Jem/Normal.png
:End:Jem:Other,lgfx/End/Jem/Other.png
:End:Jem:SpiderDemon,lgfx/End/Jem/SpiderDemon.png
:End:Stan:Barons,lgfx/End/Stan/Barons.png
:End:Stan:CyberDemon,lgfx/End/Stan/CyberDemon.png
:End:Stan:IconOfSin,lgfx/End/Stan/IconOfSin.png
:End:Stan:Normal,lgfx/End/Stan/Normal.png
:End:Stan:Other,lgfx/End/Stan/Other.png
:End:Stan:SpiderDemon,lgfx/End/Stan/SpiderDemon.png
:End:TimeOut,lgfx/End/TimeOut.png
:HUD:Battery,lgfx/HUD/Battery.png
:HUD:BatteryOutline,lgfx/HUD/BatteryOutline.png
:HUD:H_A1,lgfx/HUD/H_A1.png


+ 21
- 5
pk7/language.txt View File

@@ -212,6 +212,7 @@
"LITH_LOGON_UAC" = "\cd*** ON-BOARD COMMAND SYSTEM ACCESS TERMINAL ***";
"LITH_LOGON_DATA" = "\cu[Ship Data Terminal]";
"LITH_LOGON_TEST" = "\cgehhg.431.4122/-/<PFGR ZNE6 \cr&49c2\cg>";
"LITH_ENDING_DivisionSigil" = "\cgYou have made\n\n\n\n a dire\n\n\n\n\n mistake.\n\n\n I will not\n\n\n\n\nforgive you\n\n\n\nnor will you\n\n\n\nbe forgiven";
"LITH_BOSS_DIV_1" = "Wait.\n\nYou must leave this place.";
"LITH_BOSS_DIV_2" = "I cannot let you have it.\n\nIf you acquire it, everything will go to waste.";
"LITH_BOSS_DIV_3" = "I know you have defeated me once before.\n\nTime has repeated.";
@@ -220,10 +221,11 @@
"LITH_BOSS_DIV_6" = "I do not know if I can.\n\nLeave. Now.";
"LITH_BOSS_DIV_7" = "If you are so avaritious that you must truly defeat me once more,\n\ndo not touch the Artifact.";
"LITH_BOSS_DIV_8" = "Kill me if you must.\n\nBut I will not hold back.\n\nI plead of you to leave,\n\nor die by my hand.";
"LITH_ENDING_Credits" = "\cd>>>>> [[[[ Lithium ]]]]\n\cd>>>>> Project Golan, Xevv 2\n\n\cdOriginal music\cj for ending sequences by \cn_sink\cj\nIntermission music - \cdThe Alchemist\cj by \cnSkaven\cj\nTitle music - \cdShredder\cj by \cn505\cj\nFonts by \cnJimmy\cj\n\nSprites by:\n\cnAnthony Cole\cj, \cnBloax\cj, \cnCage\cj, \cnCaptain J\cj, \cnGAA1992\cj, \cnHorrorMovieGuy\cj, \cnKate Fox\cj, \cnMarlboro Mike\cj, \cnMarrub\cj, \cnMike12\cj, \cnMinigunner\cj, \cnMrEnchanter\cj, \cnScuba Steve\cj, \cnSeryder\cj, \cnSgt. Shivers\cj, \cnSlax\cj, \cnSolo Spaghetti\cj, \cnTheRailgunner\cj, \cnTurbo\cj, \cnwildweasel\cj, \cntorridGristle\cj, \cnzrrion the insect\cj, and others...\n\nWith sound help from:\n\cna1337spy\cj, \cnKyle873\cj, \cnShadowlink226\cj, \cnTerminusEst13\cj, \cnwildweasel\cj, and others...\n\nAnd code help from:\n\cnDavidPH\cj, \cnGutawer\cj, \cnInsanityBringer\cj, \cnKate Fox\cj, \cnMarisa Kirisame\cj, \cnYholl\cj, \cnZombie\cj\n\nAll of my thanks to:\n\cnDavidPH\cj, for making this project possible.\n\n\cnKate\cj, \cnKyle873\cj, \cnSe7enytes\cj and \cnXaser\cj, for being an inspiration.\n\n\cnMarisa\cj, \cnYholl\cj, and \cnZombie\cj, for tons of help dealing with ZDoom.";
"LITH_ENDING_Credits" = "\cd>>>>> [[[[ Lithium ]]]]\n\cd>>>>> [[[[ Project Golan, Xevv 2 ]]]]\n\n\cdOriginal music\cj for ending sequences by \cn_sink\cj\nIntermission music - \cdThe Alchemist\cj by \cnSkaven\cj\nTitle music - \cdShredder\cj by \cn505\cj\nFonts by \cnJimmy\cj\n\n\cd>>>>> [[[[ Graphics By ]]]]\n\cna1337spy\cj, \cnabbuw\cj, \cnAnthony Cole\cj, \cnBloax\cj, \cnCage\cj, \cnCaptain J\cj, \cnChronoTeeth\cj, \cnCombine_Kegan\cj, \cnDynamo\cj, \cnGAA1992\cj, \cnHorrorMovieGuy\cj, \cnJetPlane\cj, \cnKate \cnFox\cj, \cnKurashiki\cj, \cnMarlboro Mike\cj, \cnMarphy \cnBlack\cj, \cnMarrub\cj, \cnMike12\cj, \cnMinigunner\cj, \cnmonkeybtm6\cj, \cnMrEnchanter\cj, \cnRyan \cnCordell\cj, \cnScuba \cnSteve\cj, \cnSeryder\cj, \cnSgt. \cnShivers\cj, \cnSiFi \cn270\cj, \cnSkelegant\cj, \cnSlax\cj, \cnSolo \cnSpaghetti\cj, \cnTheRailgunner\cj, \cnTurbo\cj, \cnvikingbro\cj, \cnVriskaSerket\cj, \cnTerminusEst13\cj, \cnwildweasel\cj, \cntorridGristle\cj, \cnXaser\cj, \cnYholl\cj, \cnZombie\cj, and \cnzrrion\cj\n\n\cd>>>>> [[[[ Audio Help From ]]]]\n\cna1337spy\cj, \cnKyle873\cj, \cnShadowlink226\cj, \cnTerminusEst13\cj, and \cnwildweasel\cj\n\n\cd>>>>> [[[[ Code Help From ]]]]\n\cnDavidPH\cj, \cnGutawer\cj, \cnInsanityBringer\cj, \cnJimmy\cj, \cnKate Fox\cj, \cnMarisa Kirisame\cj, \cnXaser\cj, \cnYholl\cj, and \cnZombie\cj\n\n\cd>>>>> [[[[ Thank You ]]]]\n\cnDavidPH\cj, for making this project possible.\n\n\cnKate\cj, \cnKyle873\cj, \cnSe7enytes\cj and \cnXaser\cj, for being an inspiration.\n\n\cnMarisa\cj, \cnYholl\cj, and \cnZombie\cj, for tons of help.";
"LITH_ENDING_Dedication" = "Dedicated to the loving memory of Kaitlyn Anne Fox.\n You were my biggest inspiration.\n\n Goodnight.";
"LITH_ENDING_TimeOut1" = ">>>>>[[[[INCOMING MESSAGE]]]]\n\n> Remotes: <hidden>@<hidden>.mailserv, <hidden>@corp.<hidden>\n> Date: Loading...\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 1/2]]]]\n\nThe mission has failed, several samples of demonic energy have been delivered throughout A.O.F territory and are already confirmedly in their secret databases around the galaxy. You are to be immediately transfered to [REDACTED]'s military and follow all orders you are given.\n\nYou will not hear from me again.\nDelete this transmission upon reading.\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 2/2]]]]\n\n77777777777777777777777777732069089143XXXXXXXXXX\n[[[[[[[[[>> data stream corrupt, retrying";
"LITH_ENDING_TimeOut2" = ">>>>>[[[[REDELIVERING MESSAGE]]]]\n\n> Remotes: <hidden>@<hidden>.mailserv, <hidden>@corp.<hidden>\n> Date: Loading...\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 2/2]]]]\n\nHi,\n\nWe are going to transfer an undisclosed amount of funds to your account for your work. Thank you.\n\nGood luck, [REDACTED]";
"LITH_ENDING_Finished" = "The end.";
"LITH_ENDING_TimeOut_1" = ">>>>>[[[[INCOMING MESSAGE]]]]\n\n> Remotes: <hidden>@<hidden>.mailserv, <hidden>@corp.<hidden>\n> Date: Loading...\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 1/2]]]]\n\nThe mission has failed, several samples of demonic energy have been delivered throughout A.O.F territory and are already confirmedly in their secret databases around the galaxy. You are to be immediately transfered to [REDACTED]'s military and follow all orders you are given.\n\nYou will not hear from me again.\nDelete this transmission upon reading.\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 2/2]]]]\n\n77777777777777777777777777732069089143XXXXXXXXXX\n[[[[[[[[[>> data stream corrupt, retrying";
"LITH_ENDING_TimeOut_2" = ">>>>>[[[[REDELIVERING MESSAGE]]]]\n\n> Remotes: <hidden>@<hidden>.mailserv, <hidden>@corp.<hidden>\n> Date: Loading...\n\n>>>>>[[[[RECEIVING SPLIT TRANSMISSION 2/2]]]]\n\nHi,\n\nWe are going to transfer an undisclosed amount of funds to your account for your work. Thank you.\n\nGood luck, [REDACTED]";
"LITH_ENDING_Barons_Stan" = "As you're flung through the gate your body is desynthesized. If the demons were really smart enough they'd have stopped there.\n\nYour body is in Deimos now... but something feels wrong. The air is humid and hot as hell, and reality bends around you.\n\nThe walls seem to flex and twitch with your every movement. You look up to the sky and see nothing but red;\n\nDeimos is in Hell itself!\n\nYou ready yourself for the coming onslaught.";
"LITH_ENDING_CyberDemon_Stan" = "What the demon said to you still rings in your ears, as the tower collapses around you. You feel like you've been falling forever at this point, and have no idea when it will end.\n\nCould one with a mission so important really be misunderstood so badly? Did it merely mistake you for some kind of hybrid?\n\nWas it right?\n\nAll of these thoughts vanish instantly as you hit the ground harder than two planets colliding. Somehow you haven't died.\n\nYou get ready for the next wave.";
"LITH_BOSS_BAR_1_Stan" = "\cgWhat a riot!\n\cyA human comes to our domain.";
@@ -267,7 +269,13 @@
"LITH_BOSS_IOS_8_Stan" = "What kind of utter moron even takes a suicide mission?\n\nOh, I know.\n\nHa ha.";
"LITH_BOSS_IOS_9_Stan" = "You should kill yourself now.\n\nIt will be less painful than what I will do to you.";
"LITH_BOSS_IOS_10_Stan" = "Maybe your brute strength will be useful to me, even if I have to chain you down to use it.\n\nI can keep you alive as long as I want.";
"LITH_ENDING_IconOfSin_Stan" = "\cdYou awaken in a hospital bed, cybernetics turned off,\n\cdbody aching all over. It's over. The fight against\n\cdHell has been won.\n\n\cnA man is sitting next to you, and he gives you a total\n\cnfor your payment. It's too much for you to fathom. You\n\cnend up settling down in a nice house in a big city,\n\cnliving the high life.\n\n\cyThe effort you went through almost seems worth it now,\n\cybut still in your mind lingers memories of\n\cyhorrors no man should know.\n\n\ckIn the end, the corporation you worked with\n\ckmerged with a new company, the UAC, and\n\ckyou never heard from them again.\n\n\cgIf what you saw was real...\n\cg...maybe it's best nobody knows you're a hero.";
"LITH_ENDING_IconOfSin_1_Stan" = "It feels like nothing's changed.\n\n\nThose moods still take you.\n\n\nAll the time.\n\n\nYou hoped one day you would be happy. That day never came. It's just a fantasy at this point. A fantasy in the sea of a dream.\n\n\n \"Why am I like this?\"\n\n\nI don't know.\n\n\n \"Will I ever be saved?\"\n\n\nAgain, all you can bring yourself to answer,\n\n\n\n \"I don't know.\"";
"LITH_ENDING_IconOfSin_2_Stan" = "With an ocean of depressive thoughts, you considered all alternatives.\n\n\n\n\n \"Why don't I just kill myself?\"\n\n\n\n\n \"Would anyone care?\"\n\n\n\n\n No, they wouldn't.\n\n\n\n\n \"...Did anyone care in the first place?\"\n\n\n\n\n No,\n they didn't.";
"LITH_ENDING_IconOfSin_3_Stan" = "...\n\n\n \"Please, just let this end for me.\"\n\n\n......\n\n\n\n \"At least tell me why I'm alive...\"\n\n\n\n.........\n\n\n\n\"Please...\"\n\n\n\n\n Drowning in the middle of a miserable dream,\n the dream is fading away.";
"LITH_ENDING_IconOfSin_4_Stan" = "It's all you can think about. The need to get away from this life. From this accursed world. Nothing is worth it. No matter how hard you try in life,\n\n\n\n\n\n\n you are simply ignored.\n\n\n\n\n\n\nEnd it.\n\n\n\n\n\n\n \"\cgEnd this miserable existence.\c-\"";
"LITH_ENDING_IconOfSin_5_Stan" = "...\n\n ...\n\n ...\n\n «Why?»\n\n \"Why what?\"\n\n «You can't give up yet.»\n\n \"Why bother?\"\n\n «You said it yourself.»\n «You need to consider all of the alternatives.»\n\n \"\cgI have.\c-\"\n\n «You considered some.»\n «Those which give you no hope.»\n\n \"\cgWhat point is there in having hope?\c-\"\n \"\cmThere isn't anything left.\c-\"\n\n «...»\n\n \"\cgJust like I thought.\c-\"\n \"\cgYou're just a fucking idiot.\c-\"";
"LITH_ENDING_IconOfSin_6_Stan" = "...\n\n «Bring yourself to hope.»\n «For just one moment.»\n\n\n...\n\n\n\n ...\n\n\n\n\n ...\n\n\n\n ......\n\n\n «It doesn't have to end like this.»\n\n\n\n ...\n\n\n \"I can do it...\"";
"LITH_ENDING_IconOfSin_7_Stan" = "\cdYou awaken in a hospital bed, cybernetics turned off,\n\cdbody aching all over. It's over. The fight against\n\cdHell has been won.\n\n\cnA man is sitting next to you, and he gives you a total\n\cnfor your payment. It's too much for you to fathom. You\n\cnend up settling down in a nice house in a big city,\n\cnliving the high life.\n\n\cyThe effort you went through almost seems worth it now,\n\cybut still in your mind lingers memories of\n\cyhorrors no man should know.\n\n\ckIn the end, the corporation you worked with\n\ckmerged with a new company, the UAC, and\n\ckyou never heard from them again.\n\n\cgIf what you saw was real...\n\cg...maybe it's best nobody knows you're a hero.";
"LITH_ENDING_Normal_Stan" = "You finish your work on this plane of Hell and prepare for the next.\n\nSome day you'll find the end of it.";
"LITH_ENDING_SpiderDemon_Stan" = "The massive spider demon explodes into a million bits as your body is once again shuttled through dimensions of space-time.\n\nAs you travel to the next plane, your mind feels like it too is being spread infinitely. You think of a hundred things at once.\n\nA lot of them are starting to seem like sad thoughts.\n\nWhy did you get chosen?\n\nIs there really a threat, or am I just fighting such a long and horrendeous war against nothing?\n\nDid any of the demons really exaggerate?\n\nThese thoughts all seem to fly away as you are returned to the corporeal world.\n\nYou seem to be on some kind of twisted version of Earth...";
"LITH_ENDING_Barons_Jem" = "As you enter the portal you feel like you did that fated day many years ago, but it's not just your jaw now. Your whole body feels like it's been removed from this galaxy, and you're stretched across an infinitely long corridor.\n\nSub-space travel feels like a soothing lull compared to this. As you awaken on Deimos, you feel as if you've had a hangover, and woke up in the hottest depths of the sun.\n\nAs you look around yourself, you notice the heat is not coming from your body, but from everything around you. You check your depth meter to find you've successfully entered Hell.\n\nFor a moment, you almost feel like crying, but steel yourself instead.";
@@ -312,7 +320,15 @@
"LITH_BOSS_IOS_8_Jem" = "Stupid girl. Do you think those modifications could possibly trick me? Even if they could, I know your origins. You come from Delsona.";
"LITH_BOSS_IOS_9_Jem" = "It's too bad you couldn't save any of those who were captured.\nYour society is fucking laughable.";
"LITH_BOSS_IOS_10_Jem" = "A bunch of idiotic sheep waiting to be herded.\nI think I've had my fun now.\nI won't bother assimilating you.\n\cgYou\c- will simply fade into nonexistence.";
"LITH_ENDING_IconOfSin_Jem" = "\cdYou are at last free.\n\cdFree again to think and observe, and see for yourself\n\cdthe abolishment of your former captors.\n\n\cnNo more distrust of your will.\n\n\cnFor this sake, this is only the beginning.\n\n\n\ctBut for the ones you replaced, and the ones you mourn,\n\ct for yourself,\n\n\crthis is merely an end.\n\n\czPerhaps one day you will forgive yourself for\n\czwhat you have sacrificed, but today that is no matter.\n\n\cvToday is the beginning. The beginning of life once again.\n\cvYour parents are waiting back at home.\n\n\cvIt's time to go back.";
"LITH_ENDING_IconOfSin_1_Jem" = "In the beginning, you felt comfort.\n\nComfort of yourself and your home.\n\nThe allowances of personal will, of sanctity -\n\nBut so soon was it ripped away, your life in twain.\n\nWho you needed to be and who you wanted to be.\n\nThe sanctity you felt so long ago was just a facade,\nso incredibly thin,\nthe world so incredibly harsh.\n\nSo incredibly harsh, and so incapable of holding you.\n\nWhen Delsona was taken by AOF, you cried. In this moment,\nyou feel those same tears coming back to you.\n\nTears you wished for for decades.\n\nTears you prayed for.\n\nTears for the lost, the destroyed, the unneeded.\n\nTears to save them the burden.";
"LITH_ENDING_IconOfSin_2_Jem" = "It was worse than a nightmare. Every person in your prefecture,\ntaken, enslaved, killed.\n\nOne by one.\n\n\nYou feel their pain,\n\n\nall of it,\n\n\n\nand you cry.\n\nAOF took your humanity. Your sanity. Everything, from you.\n\nYour friends.\n\nYour parents.\n\nYour town.\n\nYour prefecture.\n\nDelsona.\n\nYour world.\n\nYou feel the pain of it all, and you cry harder.";
"LITH_ENDING_IconOfSin_3_Jem" = "So much suffering and loss,\n\n for what?\n\n\nPower. So much of it.\n\n\nOverwhelming control over the lives of thousands,\n\nand seeking only more.\n\n\nJust like the demons.\n\n\nBut... Somehow, worse.\n\n\nSomehow, an evil so pure,\n\n\n even the incarnation of evil\n\n\n would not stand up to it.";
"LITH_ENDING_IconOfSin_4_Jem" = "AOF took so much from you, even your identity. Unlike most like you, they couldn't give you another name. Jeremy was always your name.\n\nThis was the only mercy given.\n\nDespite your name, body, appearance, everything; you still were treated as if you had never decided to be a man. Why?\n\nCompliance is their only goal. What you want and work for do not matter here. Only that you will fight to the death for them.\n\nBut along the way, as you suffered your entombment, you learned that you were not alone.\n\nZeke was the first to approach you. Ready to die, he pleaded to you for the mercy of death. He knew quite well you couldn't. Your compassion for him knew no bounds, with no way to express it.\n\nEventually, Zeke introduced you to another friend. Daniel. The most wonderful person you ever met. Radiant with love, just like you. A woman the AOF would not accept.\n\nEven though they were able to tell you names they prefered, they weren't allowed to use them. Nor were you.\n\nZeke's sanctioned name was Jacques, from before he changed it to escape his family.\n\nDaniel's was, of all things, Cade. She never let you speak that name around her, so you always used ambiguity to refer to her.";
"LITH_ENDING_IconOfSin_5_Jem" = "The two had more in mind than just being friends with you, though.\n\nIn a matter of weeks, the Deceiver movement began. Michael taught the seven of you how to fight back. Not with weapons, but with code.\n\nZeke spearheaded the firmware hacks.\n\nSolomon, a higher-up realizing his potential to escape, masterminded the operation.\n\nSamuel and Josh mused forever about how best to destroy AOF after we were free.\n\nFinally, you were once again alive. Even if you could not see yourself, you were alive. Ready to fight.";
"LITH_ENDING_IconOfSin_6_Jem" = "And in the time it took for you to come to terms with yourself,\n\nso did the others.\n\nSamuel and Josh vowed not only to destroy AOF, but to be together for the rest of their days after this was over.\n\nSolomon wanted nothing but repentance. It took a lot to get here, and a lot of sacrifice of others.\n\nZeke wanted nothing more but to live. Finally, he had accepted life over death.\n\nMichael knew he could help others just like he had here, and vowed to commit his life to doing so.\n\nDaniel wanted to live with you, and to become your partner. She had never met someone like her before, much less someone from a place so accepting.";
"LITH_ENDING_IconOfSin_7_Jem" = "Years of planning led up to this moment.\n\nYears of tarnish and despair.\n\n\nBut there were times of happiness, however small.\n\n\nYour award for this effort is but more despair.\n\n\n\n So much sacrifice, but your sanity has returned.\n\n\n So much suffering, but you are free.\n\n\n\n So much death, but \cgyou\c- are free.";
"LITH_ENDING_IconOfSin_8_Jem" = "You finish crying. The amount of fluid coming out of your face is greater than the amount of fluid that has come out of your body since you were enslaved a millionfold.\n\nIt's over, and you can feel your senses coming back to you. You think to yourself, for once. But only sad thoughts come — What happened to the others? Will I ever know?\n\nPerhaps some truths are better left unknown.\n\nYou look around you. You see a familiar scene. A terrifying one. Yet, a happy one. You are in your home town. Burned down and barren, but still exactly as it was so many decades ago.\n\nNobody is here.\n\nYet, you feel their spirits. You feel the pulse of the planet coursing throughout your body once more. The feeling of true freedom. The freedom of movement, and to be what you wish.\n\nThere are still star-ships here. Entire warehouses untouched. Never bothered to be pillaged. Perhaps it's time to build a new home. Become the proud man you always wished to be.";
"LITH_ENDING_IconOfSin_9_Jem" = "\cdAnd so, you are at last free.\n\cdFree again to think and observe, and see for yourself\n\cdthe abolishment of your former captors.\n\n\cnNo more distrust of your will.\n\n\cnFor this sake, this is only the beginning.\n\n\n\ctBut for the ones you replaced, and the ones you mourn,\n\ct for yourself,\n\n\crthis is merely an end.\n\n\czPerhaps one day you will forgive yourself for\n\czwhat you have sacrificed, but today that is no matter.\n\n\cvToday is the beginning. The beginning of life once again.\n\cvYour parents are waiting back at home.\n\n\cvIt's time to go back.";
"LITH_ENDING_Normal_Jem" = "You exit this plane of Hell and prepare for the next.\n\nSome day this will all be over.";
"LITH_ENDING_SpiderDemon_Jem" = "The demon whithers and dies as you deliver the final blow to it. Finally, you're getting somewhere.\n\nOn the other side should be the point of humanity's origin, Earth. But as your atoms are spread across space-time you begin to wonder.\n\nDo demons truly lie?\n\nWhy does it seem that they know you so well?\n\nMore importantly, when will this finally all end?\n\nWill you ever be able to rest easily again with AOF chasing you?\n\nShould one even continue in these circumstances?";
"LITH_INFO_SHORT_AllPoint" = "AllPoint";


+ 25
- 12
pk7/lfiles/End_Barons.txt View File

@@ -1,12 +1,25 @@
case marine,3
mus lmusic/lithambientwip3.ogg
img :End:Stan:Barons
3 case cybermage,4
mus lmusic/tmary7.ogg
img :End:Jem:Barons
4 fade -50,black
case marine,1
600 $LITH_ENDING_Barons_Stan
1 case cybermage,2
800 $LITH_ENDING_Barons_Jem
2 stop
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for the Barons.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:Barons";
fade 50;
text "Barons_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:Barons";
fade 50;
text "Barons_Jem" 400 -1 100;
next;

+ 22
- 19
pk7/lfiles/End_Common.txt View File

@@ -1,19 +1,22 @@
fade 100,black
img TITLEPIC
0
fade -70,black
700 $LITH_ENDING_Credits
stop
fade 70,black
bg black
0
wait 50
100 $LITH_ENDING_Dedication
wait 100
fade 150,black
20 The end.
wait 70
fade 20,black
0
fmus 300
done
/* -*-Agw-LithEnd-*-----------------------------------------------------------| *
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Common ending routines.
*
* ---------------------------------------------------------------------------|
*/

14
imge "TITLEPIC";
fade 70;
text "Credits" 700 -1 70;
imge "";
wait 50;
text "Dedication" 100 100 150;
text "Finished" 20 70 20;
fmus 300;
next;

+ 25
- 12
pk7/lfiles/End_CyberDemon.txt View File

@@ -1,12 +1,25 @@
case marine,3
mus lmusic/lithambientwip3.ogg
img :End:Stan:CyberDemon
3 case cybermage,4
mus lmusic/tmary7.ogg
img :End:Jem:CyberDemon
4 fade -50,black
case marine,1
600 $LITH_ENDING_CyberDemon_Stan
1 case cybermage,2
800 $LITH_ENDING_CyberDemon_Jem
2 stop
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for the Cyber-Demon.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:CyberDemon";
fade 50;
text "CyberDemon_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:CyberDemon";
fade 50;
text "CyberDemon_Jem" 400 -1 100;
next;

+ 20
- 0
pk7/lfiles/End_Division.txt View File

@@ -0,0 +1,20 @@
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for the Division Sigil.
*
* ---------------------------------------------------------------------------|
*/

0 next;
1 next;
14
imge "";
musi "lmusic/siarani.ogg";
text "DivisionSigil" 900 35 100;
next;

+ 39
- 12
pk7/lfiles/End_IconOfSin.txt View File

@@ -1,12 +1,39 @@
case marine,3
mus lmusic/lithambientwip3.ogg
img :End:Stan:IconOfSin
3 case cybermage,4
mus lmusic/tmary7.ogg
img :End:Jem:IconOfSin
4 fade -50,black
case marine,1
600 $LITH_ENDING_IconOfSin_Stan
1 case cybermage,2
800 $LITH_ENDING_IconOfSin_Jem
2 stop
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for the Icon of Sin.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:IconOfSin";
fade 50;
text "IconOfSin_1_Stan" 900 -1 0;
text "IconOfSin_2_Stan" 700 -1 0;
text "IconOfSin_3_Stan" 700 -1 0;
text "IconOfSin_4_Stan" 700 -1 0;
text "IconOfSin_5_Stan" 700 -1 0;
text "IconOfSin_6_Stan" 700 -1 0;
text "IconOfSin_7_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:IconOfSin";
fade 50;
text "IconOfSin_1_Jem" 600 -1 0;
text "IconOfSin_2_Jem" 600 -1 0;
text "IconOfSin_3_Jem" 600 -1 0;
text "IconOfSin_4_Jem" 600 -1 0;
text "IconOfSin_5_Jem" 600 -1 0;
text "IconOfSin_6_Jem" 600 -1 0;
text "IconOfSin_7_Jem" 600 -1 0;
text "IconOfSin_8_Jem" 600 -1 0;
text "IconOfSin_9_Jem" 400 -1 100;
next;

+ 25
- 10
pk7/lfiles/End_Normal.txt View File

@@ -1,10 +1,25 @@
case marine,3
mus lmusic/lithambientwip3.ogg
3 case cybermage,4
mus lmusic/tmary7.ogg
4 fade -50,black
case marine,1
600 $LITH_ENDING_Normal_Stan
1 case cybermage,2
800 $LITH_ENDING_Normal_Jem
2 stop
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for non-vanilla games.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:Normal";
fade 50;
text "Normal_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:Normal";
fade 50;
text "Normal_Jem" 400 -1 100;
next;

+ 25
- 0
pk7/lfiles/End_Other.txt View File

@@ -0,0 +1,25 @@
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for other boss types.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:Other";
fade 50;
text "Other_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:Other";
fade 50;
text "Other_Jem" 400 -1 100;
next;

+ 25
- 12
pk7/lfiles/End_SpiderDemon.txt View File

@@ -1,12 +1,25 @@
case marine,3
mus lmusic/lithambientwip3.ogg
img :End:Stan:SpiderDemon
3 case cybermage,4
mus lmusic/tmary7.ogg
img :End:Jem:SpiderDemon
4 fade -50,black
case marine,1
600 $LITH_ENDING_SpiderDemon_Stan
1 case cybermage,2
800 $LITH_ENDING_SpiderDemon_Jem
2 stop
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for the Spider-Demon.
*
* ---------------------------------------------------------------------------|
*/

0
musi "lmusic/lithambientwip3.ogg";
imge ":End:Stan:SpiderDemon";
fade 50;
text "SpiderDemon_Stan" 400 -1 100;
next;
1
musi "lmusic/tmary7.ogg";
imge ":End:Jem:SpiderDemon";
fade 50;
text "SpiderDemon_Jem" 400 -1 100;
next;

+ 24
- 13
pk7/lfiles/End_TimeOut.txt View File

@@ -1,13 +1,24 @@
mus lmusic/asdfn2.ogg
bg black
fade 10,#061102
bg #061102
70 $LITH_ENDING_TimeOut_1
stop
70 $LITH_ENDING_TimeOut_2
stop
35 You turn off your communications device.
wait 70
fade 100,black
bg black
0
/* -*-Agw-LithEnd-*-----------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Ending for non-vanilla games.
*
* ---------------------------------------------------------------------------|
*/

0 next;
1 next;

14
musi "lmusic/asdfn2.ogg";
imge ":End:TimeOut";
fade 10;
text "TimeOut_1" 70 -1 0;
text "TimeOut_2" 70 -1 100;
fmus 70;
next;

BIN
pk7/lgfx/End/Jem/Barons.png View File

Before After
Width: 320  |  Height: 200  |  Size: 60KB

BIN
pk7/lgfx/End/Jem/CyberDemon.png View File

Before After
Width: 320  |  Height: 200  |  Size: 124KB

BIN
pk7/lgfx/End/Jem/Normal.png View File

Before After
Width: 320  |  Height: 200  |  Size: 149KB

BIN
pk7/lgfx/End/Jem/Other.png View File

Before After
Width: 320  |  Height: 200  |  Size: 166KB

BIN
pk7/lgfx/End/Jem/SpiderDemon.png View File

Before After
Width: 320  |  Height: 200  |  Size: 118KB

BIN
pk7/lgfx/End/Stan/Barons.png View File

Before After
Width: 320  |  Height: 200  |  Size: 29KB

BIN
pk7/lgfx/End/Stan/CyberDemon.png View File

Before After
Width: 320  |  Height: 200  |  Size: 20KB

BIN
pk7/lgfx/End/Stan/Normal.png View File

Before After
Width: 320  |  Height: 200  |  Size: 4.6KB

BIN
pk7/lgfx/End/Stan/Other.png View File

Before After
Width: 320  |  Height: 200  |  Size: 16KB

BIN
pk7/lgfx/End/Stan/SpiderDemon.png View File

Before After
Width: 320  |  Height: 200  |  Size: 4.6KB

BIN
pk7/lgfx/End/TimeOut.png View File

Before After
Width: 320  |  Height: 200  |  Size: 102B

BIN
pk7/lmusic/siarani.ogg View File


+ 0
- 1
pk7/lzscript/Playsim.zsc View File

@@ -10,7 +10,6 @@
#include "lzscript/Playsim/Server.zsc"

#include "lzscript/Playsim/Cyberspace.zsc"
#include "lzscript/Playsim/EndSeq.zsc"
#include "lzscript/Playsim/Events.zsc"
#include "lzscript/Playsim/Files.zsc"
#include "lzscript/Playsim/Monsters.zsc"


+ 0
- 253
pk7/lzscript/Playsim/EndSeq.zsc View File

@@ -1,253 +0,0 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

struct Lith_EndSeqNode {
name Type;
uint Tics;
string Text;
}

extend class Lith_HERMES;

enum Lith_EndSeqState {
ESEQ_HALT,

ESEQ_RUN,

ESEQ_STOP,

ESEQ_WAIT,
ESEQ_WRITEOUT,
ESEQ_FADEOUT,
ESEQ_FADEIN,
ESEQ_FADEMUS,
}

/* Program */
private ui uint m_P;
private ui Lith_EndSeqNode m_Node[32];
private ui uint16 m_Jmp[99];

/* State */
private ui uint m_ESeq;
private ui color m_BgColo, m_FdColo;
private ui string m_Text;
private ui textureid m_BgImg;
private ui int m_Time, m_Tics, m_Skip;

ui int LoadEnding(string fname, int start) {
let lmp = Lith_HERMES.ReadLump(Lith_HERMES.FindLump(fname));

array<string> lns, arg;

lmp.Split(lns, "\n");

m_BgColo = "Black";
m_FdColo = "Black";
m_Text = "";

int which;
for(uint i = 0, l = lns.size(); i < l; i++) {
if(lns[i] == "") continue;

which = start + i;

string ln = lns[i].Mid(3);
string jp = lns[i].Left(2);
uint space = ln.Indexof(" ");

string fn = space >= 0 ? ln.Left(space) : ln;
string ar = space >= 0 ? ln.Mid(space+1) : "";

if(jp.ToInt() > 0) m_Jmp[jp.ToInt()] = i;

if(fn.ToInt() > 0 || fn == "0") {
m_Node[which].Type = 'text';
m_Node[which].Tics = fn.ToInt();
m_Node[which].Text = StringTable.Localize(ar, true);
continue;
}

if(ar != "") {
arg.Clear();
ar.Split(arg, ",");
}

let nam = name(fn);
m_Node[which].Type = nam;
switch(nam) {
case 'stop':
case 'done':
break;
case 'img':
case 'mus':
case 'bg':
m_Node[which].Text = arg[0];
break;
case 'fmus':
case 'wait':
m_Node[which].Tics = arg[0].ToInt();
break;
case 'case':
m_Node[which].Text = arg[0];
m_Node[which].Tics = arg[1].ToInt();
break;
case 'fade':
m_Node[which].Tics = arg[0].ToInt();
m_Node[which].Text = arg[1];
break;
}
}

m_ESeq = ESEQ_RUN;

return which;
}

ui void DrawEndSequence(RenderEvent evt) {
Screen.Dim(m_BgColo, 1, 0, 0, Screen.GetWidth(), Screen.GetHeight());

if(m_BgImg)
Screen.DrawTexture(m_BgImg, false, 0, 0, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200);

string txt = m_Text;

if(m_ESeq == ESEQ_WRITEOUT) {
uint len = m_Text.length();
uint prc = m_Time*IFIX / m_Tics; /* divide (k/i) */
uint amt = len * prc / IFIX; /* multiply (i*k) and remove decimal */
txt = m_Text.left(amt);
}

if(txt != "") {
let lns = smallfont.breakLines(txt, 310);
for(int i = 0, n = lns.count(); i < n; i++) {
int y = i * smallfont.getHeight() + 10;
Screen.DrawText(smallfont, Font.CR_WHITE, 10, y, lns.stringAt(i), DTA_VirtualWidth, 320, DTA_VirtualHeight, 240);
}
}

switch(m_ESeq) {
case ESEQ_FADEMUS:
SetMusicVolume(1 - m_Time / double(m_Tics));
break;
case ESEQ_FADEIN:
case ESEQ_FADEOUT: {
double fd = m_Time / double(m_Tics);
if(m_ESeq == ESEQ_FADEIN) fd = 1 - fd;
Screen.Dim(m_FdColo, fd, 0, 0, Screen.GetWidth(), Screen.GetHeight());
break;
}
}

if(m_Skip)
Screen.DrawText(smallfont, Font.CR_WHITE, 5, 0, String.Format("Skip: %u", 1 + m_Skip / 10), DTA_VirtualWidth, 320, DTA_VirtualHeight, 240);
}

ui void RunEndSequence() {
PlayerInfo p = Players[ConsolePlayer];
let btn = p.Cmd.Buttons;
let old = p.OldButtons;

if(m_ESeq >= ESEQ_WAIT) {
if(btn & BT_ALTATTACK) {
if(m_Skip) {
if(--m_Skip == 0) {
m_ESeq = ESEQ_RUN;
m_P++;
}
} else {
m_Skip = 25;
}
} else if(m_Time < m_Tics) {
m_Skip = 0;

if(btn & BT_USE && m_Time > 12) m_Time += 3;
else m_Time++;

if(m_Time > m_Tics) m_Time = m_Tics;
} else {
m_Skip = 0;

m_ESeq = ESEQ_RUN;
m_P++;
}
} else if(m_ESeq == ESEQ_STOP) {
if(btn & BT_ALTATTACK || (btn ^ old && (btn & old) == p.OldButtons && p.Bot == null)) {
m_ESeq = ESEQ_RUN;
m_P++;
}
}

while(m_ESeq == ESEQ_RUN) {
switch(m_Node[m_P].Type) {
case 'mus':
S_ChangeMusic(m_Node[m_P++].Text);
break;
case 'done':
Menu.SetMenu('EndGameMenu');
MessageBoxMenu(Menu.GetCurrentMenu()).HandleResult(true);
m_ESeq = ESEQ_HALT;
break;
case 'stop':
m_ESeq = ESEQ_STOP;
break;
case 'img': {
string tex = m_Node[m_P++].Text;
if(tex.byteAt(0) == Ch_Colon) tex = StringTable.Localize(tex, false);
m_BgImg = TexMan.CheckForTexture(tex, TexMan.Type_Any);
break;
}
case 'bg':
m_BgColo = m_Node[m_P++].Text;
m_BgImg.SetNull();
break;
case 'case': {
bool cnd;

switch(name(m_Node[m_P].Text)) {
case 'marine': cnd = p.Cls == "Lith_MarinePlayer"; break;
case 'cybermage': cnd = p.Cls == "Lith_CyberMagePlayer"; break;
default: cnd = false; break;
}

if(cnd) m_P++;
else m_P = m_Jmp[m_Node[m_P].Tics];

break;
}
case 'wait':
m_Tics = m_Node[m_P].Tics;
m_Time = 1;
m_ESeq = ESEQ_WAIT;
break;
case 'fmus':
m_Tics = m_Node[m_P].Tics;
m_Time = 1;
m_ESeq = ESEQ_FADEMUS;
break;
case 'fade':
m_FdColo = m_Node[m_P].Text;
m_Tics = m_Node[m_P].Tics;
m_Time = 1;
if(m_Tics < 0) {m_ESeq = ESEQ_FADEIN; m_Tics = -m_Tics;}
else m_ESeq = ESEQ_FADEOUT;
break;
case 'text':
m_Text = m_Node[m_P].Text;
m_Tics = m_Node[m_P].Tics;
m_Time = 1;
if(m_Tics > 0) m_ESeq = ESEQ_WRITEOUT;
else m_P++;
break;
}
}
}

/* EOF */

+ 86
- 39
pk7/lzscript/Playsim/Events.zsc View File

@@ -24,34 +24,89 @@ private array<Actor> m_bossBabies;
private int m_bossDeathInit;
bool m_wasFinal;

static void SetEnding(string ending)
{if(__lith_end == "") CVar.FindCVar('__lith_end').SetString(ending);}

static int GetBossLevel() {return Instance().m_bossLevel;}

override void WorldLoaded(WorldEvent ev)
{
/* TODO: hashes for doom.wad (1.9, BFG), doom1.wad (1.9), doom2.wad (BFG),
hashes for community maps, etc */
static const string BOSS_E1[] = {
"058fb092ea1b70da1e3cbf501c4a91a1" /* doom.wad (1.9ud) E1M8 */
static const string BH_BARONS[] = {
"ED26C05D1B179D373E839AC7CCFB07AE", // 2002ado.wad e1m8
"769CEC2DD419996D43D23AEBBE11DF45", // deathless.wad e1m8
"058FB092EA1B70DA1E3CBF501C4A91A1", // doom_v1_9ud.wad e1m8
"FAF0015E874A7106098B290D8B2E6160", // dtwid-le.wad e1m8
"454BD1AD5A8137AEBAC184A527321D12", // dtwid-le.wad e6m1
"D8811A9FA512F8118701E6E9F2F81545", // dtwid-le.wad e6m2
"5C81C1FB5F41CB2B1B963C20E9ABE8B4", // dtwid.wad e1m8
"A1F105211112747EE50BA520462A471E", // e1m8b.wad e1m8
"1DD919F39F45E0EA70E45EF7814144D9", // killed.wad e1m8
"C5E8223F29F1FB6E28D29B057DE35B99", // neis.wad e1m8
"0D458EA6A1610FB350560631074E944E" // sgnsym.wad e1m8
};

static const string BOSS_E2[] = {
"effe91df41ad41f6973c06f0ad67ddb9" /* doom.wad (1.9ud) E2M8 */
static const string BH_CYBERDEMON[] = {
"C6DCCA7A718274FB49DC51B91737A96A", // 2002ado.wad e2m8
"DAE486C710EAB555BC2B2655F758F574", // bgcomp.wad e2m8
"C770E40696DB5AF106FFE678F50EB5F5", // deathless.wad e2m8
"EFFE91DF41AD41F6973C06F0AD67DDB9", // doom_v1_9ud.wad e2m8
"7BD08EE245649C097B197C4EEFBE61F7", // dtwid-le.wad e2m8
"5A6CF03980A3522CEB05F9EA561A28B0", // dtwid-le.wad e5m8
"3BE0A3EE53EA321D1340A0F567DD95F5", // dtwid-le.wad e6m3
"616B18EDBE0492DD6B46A59B1B540A05", // dtwid-le.wad e6m4
"477B746A819700AE28007B51E0F2E43D", // dtwid.wad e2m8
"8BB67F9A2DAAA92BDDD36DD5177D5D77", // neis.wad e2m8
"675864248BC8E4DBDBECB04F5219E1C2" // nihility.wad e2m8
};

static const string BOSS_E3[] = {
"ef128313112110ed6c1549af96af26c9" /* doom.wad (1.9ud) E3M8 */
static const string BH_SPIDERDEMON[] = {
"2800B7E9E11BE12E1932517F12C7B293", // 2002ado.wad e3m8
"9667D55631A4BEC379B64B5F3305CEDA", // bgcomp.wad e1m8
"4D413260D32605CBFC17FCA019D03E1C", // deathless.wad e3m8
"EF128313112110ED6C1549AF96AF26C9", // doom_v1_9ud.wad e3m8
"18D8403D0F206F756BAF316DA105E316", // dtwid-le.wad e3m8
"511B8D96025725ACDF0C231B8B76BD83", // dtwid-le.wad e6m5
"E1753AB1297DA9733620D870B127D248", // dtwid-le.wad e6m6
"B443AC8D4A8EAA592F32C12C7789CE33", // dtwid-le.wad e6m7
"F9C74E08846B6CF879B31ED888EDFBF2", // dtwid-le.wad e6m8
"122DE53472FF547DE3BDB5FF879F653B", // dtwid.wad e3m8
"B5795436228DEEB3492275F4432E9FC1", // griefless.wad e4m8
"5978E4815FC2E78B3B6BBEBC44B3953F" // neis.wad e3m8
};

static const string BOSS_E4[] = {
"2dc939e508ab8eb68af79d5b60568711" /* doom.wad (1.9ud) E4M8 */
static const string BH_OTHER[] = {
"96A77422246EB76ACFF80821890FA274", // 2002ado.wad e4m8
"9A4D38004A4E37B3018755E08E755228", // aa_e1.wad e1m8
"A9795AAC7F2BFAE05F4930243841DC0C", // bgcomp.wad e3m8
"FAD19FE85C24AC6CC60C62A96AE77D21", // dbimpact.wad e1m8
"588032F3E53414C157AA5B879A4FABA8", // deathless.wad e4m8
"2DC939E508AB8EB68AF79D5B60568711", // doom_v1_9ud.wad e4m8
"7C0C749E664F27E16E3BEFE85E7BF7E7", // draftex.wad e4m8
"DDF5419C201C05009ABF962F1BE06D88", // dtwid-le.wad e4m8
"5C5E5C08AF3572F31CF27318679F2B4E", // eviternity.wad map30
"252872EE2E97646C8EE1491368B3E204", // hadrone2.wad e2m8
"D9FADBA97FA5E52EE74D5822C911574C", // hadronf.wad e1m8
"987A8EB619CA9399EB549FBA9C4D1BD4", // hr2final.wad map30
"159C6507BA6881FC25DE7E2AA8E9E09D", // icarus.wad map30
"CC9DA2427DFCC5116D56D163F0AEF394", // jenesis.wad map30
"16252665DEB8F3D44973A13C332C94D3", // neis.wad e4m8
"6EAD80DA1F30B4B3546FA294EEF9F87C", // sigil_v1_21.wad e5m8
"75AD07EB0B915DE49DABCC3B9158161D" // udtwid.wad e4m8
};

static const string BOSS_D2[] = {
"5eecd88f4491f516d590ce4bbf45f532", /* doom2.wad (1.9) MAP30 */
"b304ac2e0c15b97fe9e2dcd5cff9066c" /* freedoom2.wad (0.12.1) MAP30 */
static const string BH_ICONOFSIN[] = {
"3052920C1E7FB5373F79AC27B38FC503", // d2ino.wad map30
"A39B7038C999778EF574A83D95EDD55D", // d2twid.wad map30
"5EECD88F4491F516D590CE4BBF45F532", // doom2_v1_9.wad map30
"B304AC2E0C15B97FE9E2DCD5CFF9066C", // freedoom2_v0_12_1.wad map30
"B45AA2A2147A6A5D1E2739691AD21710", // hr.wad map30
"58365647EA55B9E159B362D19824440D", // jpcp.wad map30
"546B625814773AC1396C363540304E12", // mm.wad map30
"A928B525B91D1CF2259686064AA4AB08", // mm2.wad map30
"B35281F3758CE6ACAA3B79C3A107DC3B", // pl2.wad map30
"279BB50468FE9F5B36C6D821E4902369", // plutonia.wad map30
"683FC120CCB157549FDC447CFFFAFC29", // reverie.wad map30
"FCB39D9C3DD5182D467E9E84EA6CC69F", // scythe.wad map30
"3494B0A09D14B8DBB3386BBD42B23A3A", // scythe2.wad map30
"42B68B84FF8E55F264C31E6F4CFEA82D", // tnt.wad map30
"DA38541C021A24295986E4CC1FF65D68" // urania.wad map30
};

m_bossLevel = boss_none;
@@ -59,16 +114,21 @@ override void WorldLoaded(WorldEvent ev)
m_bossBabies.clear();

let sum = Level.GetChecksum();
for(int i = 0; i < BOSS_E1.Size(); i++)
if(sum == BOSS_E1[i]) {m_bossLevel = boss_barons; break;}
for(int i = 0; i < BOSS_E2.Size(); i++)
if(sum == BOSS_E2[i]) {m_bossLevel = boss_cyberdemon; break;}
for(int i = 0; i < BOSS_E3.Size(); i++)
if(sum == BOSS_E3[i]) {m_bossLevel = boss_spiderdemon; break;}
for(int i = 0; i < BOSS_E4.Size(); i++)
if(sum == BOSS_E4[i]) {m_bossLevel = boss_other; break;}
for(int i = 0; i < BOSS_D2.Size(); i++) {
if(sum == BOSS_D2[i]) {

for(int i = 0; i < BH_BARONS.Size(); i++)
if(sum ~== BH_BARONS[i]) {m_bossLevel = boss_barons; break;}

for(int i = 0; i < BH_CYBERDEMON.Size(); i++)
if(sum ~== BH_CYBERDEMON[i]) {m_bossLevel = boss_cyberdemon; break;}

for(int i = 0; i < BH_SPIDERDEMON.Size(); i++)
if(sum ~== BH_SPIDERDEMON[i]) {m_bossLevel = boss_spiderdemon; break;}

for(int i = 0; i < BH_OTHER.Size(); i++)
if(sum ~== BH_OTHER[i]) {m_bossLevel = boss_other; break;}

for(int i = 0; i < BH_ICONOFSIN.Size(); i++) {
if(sum ~== BH_ICONOFSIN[i]) {
m_bossLevel = boss_iconofsin;
if(__lith_fun & lfun_final) m_wasFinal = true;
break;
@@ -160,16 +220,6 @@ override void UiTick()
{
if(GameState == GS_FINALE && (!Level.NextMap || Level.NextMap.Left(6) == "enDSeQ"))
CallACS("Lith_Finale");

if(m_ESeq == ESEQ_HALT && __lith_end != "")
{
int which =
LoadEnding(String.Format("lfiles/End_%s.txt", __lith_end), 0);
LoadEnding("lfiles/End_Common.txt", which);
CVar.FindCVar('__lith_end').SetString("");
}
else if(m_ESeq >= ESEQ_RUN)
RunEndSequence();
}

override void WorldThingSpawned(WorldEvent ev)
@@ -453,9 +503,6 @@ override void RenderOverlay(RenderEvent evt) {
Shader.SetUniform1f(player, "Lith_End", "lith_t", ftic - 15.0);
}
}

if(m_ESeq >= ESEQ_RUN)
DrawEndSequence(evt);
}

/* EOF */

+ 7
- 0
pk7/lzscript/Playsim/World.zsc View File

@@ -9,6 +9,13 @@

extend class Lith_HERMES;

ui static void ActuallyEndTheGame() {
// HERE IT IS
// THE WORST HACK IN THE MOD BABEY
Menu.SetMenu('EndGameMenu');
MessageBoxMenu(Menu.GetCurrentMenu()).HandleResult(true);
}

static int FindFontColor(name cr) {
return Font.FindFontColor(cr);
}


+ 1
- 0
pk7/mapinfo.txt View File

@@ -149,6 +149,7 @@ skill nightmare {
}

map TITLEMAP "Lithium Title" {
LevelNum = 18883001
Sky1 = "LITHSKRD", 0.05
Sky2 = "LITHSKS1"
DoubleSky


+ 2
- 2
pk7_ep1/mapinfo.txt View File

@@ -10,7 +10,7 @@
/* Maps -------------------------------------------------------------------- */

map M1A1 "Begin The Begin" {
LevelNum = 18883001
LevelNum = 18883101
Sky1 = "LITHN16S"
Music = "lmusic/M1A1.ogg"

@@ -18,7 +18,7 @@ map M1A1 "Begin The Begin" {
}

map M1A2 "The Ash Is Burning" {
LevelNum = 18883002
LevelNum = 18883102
Music = "lmusic/M1A2.ogg"
}



+ 12
- 14
source/d_compile.c View File

@@ -90,11 +90,10 @@ static bool Dlg_GetItem(struct compiler *d, u32 act)
struct token *tok = d->tb.get();

if(faststrcmp(tok->textV, "page") == 0) {
tok = d->tb.get();
Expect(d, tok, tok_number);
tok = d->tb.expc(d->tb.get(), tok_number);

u32 num = strtoi(tok->textV, nil, 0);
if(num > DPAGE_NORMAL_MAX) Err(d, "bad page index");
if(num > DPAGE_NORMAL_MAX) d->tb.err("bad page index");

Dlg_GetItem_Page(d, num, act);
return true;
@@ -117,13 +116,12 @@ static bool Dlg_GetItem(struct compiler *d, u32 act)

static void Dlg_GetTop_Prog(struct compiler *d, u32 act, u32 beg, u32 end)
{
struct token *tok = d->tb.get();
Expect(d, tok, tok_number);
struct token *tok = d->tb.expc(d->tb.get(), tok_number);

u32 num = beg + strtoi(tok->textV, nil, 0);
if(num > end) ErrF(d, "invalid dialogue number %u", num);
if(num > end) d->tb.err("invalid dialogue number %u", num);

ExpectDrop(d, tok_semico);
d->tb.expdr(tok_semico);

FinishDef(d);
d->num = num;
@@ -218,22 +216,22 @@ void Dlg_MInit(void)

FILE *fp =
W_Open(StrParam("lfiles/Dialogue_%tS.txt", PRINTNAME_LEVEL), "r");

if(fp) {
struct compiler d = {{.bbeg = 14, .bend = 28, .fp = fp}, .ok = true};
static struct compiler d = {};

d.tb.fp = fp;

TBufCtor(&d.tb);

if(setjmp(d.env)) {
d.ok = false;
if(setjmp(d.tb.env)) {
goto done;
}

for(;;) {
struct token *tok = d.tb.get();
struct token *tok = d.tb.expc2(d.tb.get(), tok_identi, tok_eof);
if(tok->type == tok_eof) break;

Expect(&d, tok, tok_identi);

if(faststrcmp(tok->textV, "program") == 0)
Dlg_GetTop_Prog(&d, ACT_NONE, DNUM_PRG_BEG, DNUM_PRG_END);
else if(faststrcmp(tok->textV, "dialogue") == 0)
@@ -241,7 +239,7 @@ void Dlg_MInit(void)
else if(faststrcmp(tok->textV, "terminal") == 0)
Dlg_GetTop_Prog(&d, ACT_TRM_WAIT, DNUM_TRM_BEG, DNUM_TRM_END);
else
ErrF(&d, "invalid toplevel item '%s'", tok->textV);
d.tb.err("invalid toplevel item '%s'", tok->textV);
}




+ 4
- 4
source/d_cutil.c View File

@@ -19,14 +19,14 @@ void Dlg_PushB1(struct compiler *d, u32 b)
{
size_t pc = d->def.codeP++;

if(pc + 1 > PRG_END - PRG_BEG) Err(d, "PRG segment overflow");
if(pc + 1 > PRG_END - PRG_BEG) d->tb.err("PRG segment overflow");

if(pc + 1 > d->def.codeC * 4) {
Vec_Grow(d->def.code, 1);
d->def.codeC++;
}

if(b > 0xFF) ErrF(d, "byte error (overflow) %u", b);
if(b > 0xFF) d->tb.err("byte error (overflow) %u", b);

Cps_SetC(d->def.codeV, pc, b);
}
@@ -66,7 +66,7 @@ struct ptr2 Dlg_PushLdAdr(struct compiler *d, u32 at, u32 set)

void Dlg_SetB1(struct compiler *d, u32 ptr, u32 b)
{
if(b > 0xFF) ErrF(d, "byte error (overflow) %u", b);
if(b > 0xFF) d->tb.err("byte error (overflow) %u", b);

Cps_SetC(d->def.codeV, ptr, b);
}
@@ -82,7 +82,7 @@ u32 Dlg_PushStr(struct compiler *d, cstr s, u32 l)
u32 p = d->def.stabP;
u32 vl = Cps_Adjust(p + l) - d->def.stabC;

if(p + l > STR_END - STR_BEG) Err(d, "STR segment overflow");
if(p + l > STR_END - STR_BEG) d->tb.err("STR segment overflow");

Dbg_Log(log_dlg, "%s: (%3u %3u) '%s'", __func__, l, vl, s);



+ 18
- 26
source/d_stmt.c View File

@@ -17,14 +17,12 @@

void Dlg_GetStmt_Cond(struct compiler *d)
{
struct token *tok = d->tb.get();
Expect(d, tok, tok_identi);
struct token *tok = d->tb.expc(d->tb.get(), tok_identi);

bool bne = true;

if(faststrcmp(tok->textV, "item") == 0) {
tok = d->tb.get();
Expect(d, tok, tok_string);
tok = d->tb.expc(d->tb.get(), tok_string);

bne = false;

@@ -32,8 +30,7 @@ void Dlg_GetStmt_Cond(struct compiler *d)

Dlg_PushLdVA(d, ACT_LD_ITEM);
} else if(faststrcmp(tok->textV, "class") == 0) {
tok = d->tb.get();
Expect(d, tok, tok_identi);
tok = d->tb.expc(d->tb.get(), tok_identi);

Dlg_PushB1(d, DCD_LDA_AI);
Dlg_PushB2(d, VAR_PCLASS);
@@ -42,9 +39,9 @@ void Dlg_GetStmt_Cond(struct compiler *d)
#define PCL(shr, lng) \
if(faststrcmp(tok->textV, #shr) == 0) {Dlg_PushB1(d, shr); goto ok;}
#include "p_player.h"
ErrT(d, tok, "invalid playerclass type");
d->tb.errtk(tok, "invalid playerclass type");
} else {
ErrT(d, tok, "invalid conditional type");
d->tb.errtk(tok, "invalid conditional type");
}

ok:
@@ -61,7 +58,7 @@ ok:
u32 else_ptr;

tok = d->tb.get();
if(CheckKw(tok, "else")) {
if(TokIsKw(tok, "else")) {
Dlg_PushB1(d, DCD_JMP_AI);
Dlg_PushB2(d, 0);
else_ptr = d->def.codeP;
@@ -98,8 +95,7 @@ void Dlg_GetStmt_Option(struct compiler *d)
{
struct ptr2 adr;

struct token *tok = d->tb.get();
Expect2(d, tok, tok_identi, tok_string);
struct token *tok = d->tb.expc2(d->tb.get(), tok_identi, tok_string);

Dlg_PushLdAdr(d, VAR_ADRL, Dlg_PushStr(d, tok->textV, tok->textC));
adr = Dlg_PushLdAdr(d, VAR_RADRL, 0); /* placeholder */
@@ -122,24 +118,23 @@ void Dlg_GetStmt_Option(struct compiler *d)

void Dlg_GetStmt_Page(struct compiler *d)
{
struct token *tok = d->tb.get();
Expect(d, tok, tok_number);
struct token *tok = d->tb.expc(d->tb.get(), tok_number);
Dlg_PushB1(d, DCD_JPG_VI);
Dlg_PushB1(d, strtoi(tok->textV, nil, 0));
}

void Dlg_GetStmt_Str(struct compiler *d, u32 adr)
{
struct token *tok = d->tb.get();
Expect3(d, tok, tok_identi, tok_string, tok_number);
struct token *tok =
d->tb.expc3(d->tb.get(), tok_identi, tok_string, tok_number);
Dlg_PushLdAdr(d, adr, Dlg_PushStr(d, tok->textV, tok->textC));
}

void Dlg_GetStmt_Terminal(struct compiler *d, bool use_s, u32 act)
{
if(use_s) {
struct token *tok = d->tb.get();
Expect3(d, tok, tok_identi, tok_string, tok_number);
struct token *tok =
d->tb.expc3(d->tb.get(), tok_identi, tok_string, tok_number);
Dlg_PushLdAdr(d, VAR_PICTL, Dlg_PushStr(d, tok->textV, tok->textC));
}

@@ -156,8 +151,7 @@ void Dlg_GetStmt_Terminal(struct compiler *d, bool use_s, u32 act)

void Dlg_GetStmt_Num(struct compiler *d, u32 act)
{
struct token *tok = d->tb.get();
Expect(d, tok, tok_number);
struct token *tok = d->tb.expc(d->tb.get(), tok_number);

Dlg_PushLdAdr(d, VAR_ADRL, strtoi(tok->textV, nil, 0) & 0xFFFF);
Dlg_PushLdVA(d, act);
@@ -165,8 +159,7 @@ void Dlg_GetStmt_Num(struct compiler *d, u32 act)

void Dlg_GetStmt_Script(struct compiler *d)
{
struct token *tok = d->tb.get();
Expect2(d, tok, tok_string, tok_number);
struct token *tok = d->tb.expc2(d->tb.get(), tok_string, tok_number);

u32 act;

@@ -186,8 +179,7 @@ void Dlg_GetStmt_Script(struct compiler *d)
}

for(u32 i = 0; i < 4 && d->tb.drop(tok_comma); i++) {
tok = d->tb.get();
Expect(d, tok, tok_number);
tok = d->tb.expc(d->tb.get(), tok_number);

u32 prm = strtoi(tok->textV, nil, 0);

@@ -250,14 +242,14 @@ script void Dlg_GetStmt(struct compiler *d)

break;
case tok_lt:
while((tok = d->tb.get())->type != tok_gt) {
Expect(d, tok, tok_number);
while((tok = d->tb.expc2(d->tb.get(), tok_number, tok_gt))->type !=
tok_gt) {
Dlg_PushB1(d, strtoi(tok->textV, nil, 0));
}
case tok_semico:
break;
default:
ErrT(d, tok, "invalid token in statement");
d->tb.errtk(tok, "invalid token in statement");
break;
}
}


+ 5
- 5
source/d_stmt_asm.c View File

@@ -28,7 +28,7 @@ static i32 CodeABS(struct compiler *d, cstr reg)
} else if(d->tb.drop(tok_comma)) {
tok = d->tb.get();

if(CheckKw(tok, reg)) return n;
if(TokIsKw(tok, reg)) return n;

d->tb.unget();
}
@@ -53,7 +53,7 @@ static i32 CodeZPG(struct compiler *d, cstr reg)
} else if(d->tb.drop(tok_comma)) {
tok = d->tb.get();

if(CheckKw(tok, reg)) return n;
if(TokIsKw(tok, reg)) return n;

d->tb.unget();
}
@@ -130,7 +130,7 @@ static bool CodeIX(struct compiler *d, u32 code)
if(n <= 0xFF && d->tb.drop(tok_comma)) {
tok = d->tb.get();

if(CheckKw(tok, "X") && d->tb.drop(tok_parenc)) {
if(TokIsKw(tok, "X") && d->tb.drop(tok_parenc)) {
Dlg_PushB1(d, code);
Dlg_PushB1(d, n);
return true;
@@ -157,7 +157,7 @@ static bool CodeIY(struct compiler *d, u32 code)
if(n <= 0xFF && d->tb.drop(tok_parenc) && d->tb.drop(tok_comma)) {
tok = d->tb.get();

if(CheckKw(tok, "Y")) {
if(TokIsKw(tok, "Y")) {
Dlg_PushB1(d, code);
Dlg_PushB1(d, n);
return true;
@@ -243,7 +243,7 @@ void Dlg_GetStmt_Asm(struct compiler *d)
#include "d_vm.h"

tok = d->tb.reget();
ErrT(d, tok, "no function found with this syntax");
d->tb.errtk(tok, "no function found with this syntax");
}

/* EOF */

+ 16
- 0
source/debug.c View File

@@ -189,4 +189,20 @@ void Sc_PrintMonsterInfo(void) {
PrintMonsterInfo();
}

script_str ext("ACS") addr(OBJ "TriggerEnding")
void Sc_TriggerEnding(i32 num) {
cstr which;
switch(num) {
default:
case 0: which = "Division"; break;
case 1: which = "Other"; break;
case 2: which = "Normal"; break;
case 3: which = "Barons"; break;
case 4: which = "CyberDemon"; break;
case 5: which = "SpiderDemon"; break;
case 6: which = "IconOfSin"; break;
}
F_Start(which);
}

/* EOF */

+ 1
- 0
source/include/common.h View File

@@ -52,6 +52,7 @@
#define TickerT(t, on, off) ((ACS_Timer() % 35) < (t) ? (on) : (off))
#define Ticker(on, off) (TickerT(17, on, off))

#define FourCCPtr(s) FourCC((s)[0], (s)[1], (s)[2], (s)[3])
#define FourCC(a, b, c, d) ((d << 24) | (c << 16) | (b << 8) | (a << 0))

#define SCallI ACS_ScriptCall


+ 0
- 37
source/include/d_compile.h View File

@@ -21,49 +21,12 @@
#include "m_file.h"
#include "m_tokbuf.h"

#include <setjmp.h>

#define Error(d) longjmp((d)->env, 1)

#define ErrF(d, fmt, ...) \
(Log("%s: " fmt, __func__, __VA_ARGS__), Error(d))

#define Err(d, fmt) \
(Log("%s: " fmt, __func__), Error(d))

#define ErrT(d, tok, s) \
(Log("(%i:%i) %s: " s " (%i:'%s')", tok->orig.line, tok->orig.colu, \
__func__, tok->type, tok->textV ? tok->textV : "<no string>"), \
Error(d))

#define Expect(d, tok, typ) \
if(tok->type != typ) ErrT(d, tok, "expected " #typ)

#define Expect2(d, tok, typ1, typ2) \
if(tok->type != typ1 && tok->type != typ2) \
ErrT(d, tok, "expected " #typ1 " or " #typ2)

#define Expect3(d, tok, typ1, typ2, typ3) \
if(tok->type != typ1 && tok->type != typ2 && tok->type != typ3) \
ErrT(d, tok, "expected " #typ1 ", " #typ2 " or " #typ3)

#define ExpectDrop(d, typ) \
if(!d->tb.drop(typ)) {\
struct token *_tok = d->tb.reget(); \
ErrT(d, _tok, "expected " #typ); \
}

#define CheckKw(tok, kw) \
(tok->type == tok_identi && faststrcmp(tok->textV, kw) == 0)

/* Types ------------------------------------------------------------------- */

struct compiler {
struct tokbuf tb;
struct dlg_def def;
u32 num;
jmp_buf env;
bool ok;
};

/* Extern Functions -------------------------------------------------------- */


+ 0
- 3
source/include/m_file.h View File

@@ -16,9 +16,6 @@

#include <stdio.h>

#define W_Find(name) ServCallI(sm_FindLump, name)
#define W_Read(lmp) ServCallS(sm_ReadLump, lmp)

#define FEOF(fp) ((fp)->_flag & _FILEFLAG_EOF)

FILE *W_Open(str fname, cstr rw);


+ 21
- 8
source/include/m_tokbuf.h View File

@@ -18,9 +18,13 @@
#include "m_types.h"

#include <stdbool.h>
#include <setjmp.h>
#include <stdarg.h>

/* Extern Functions -------------------------------------------------------- */

i32 TBufProc (struct token *tok);
i32 TBufProcL(struct token *tok);
void TBufCtor (struct tokbuf *tb);
void TBufDtor (struct tokbuf *tb);
struct token *TBufGet (struct tokbuf *tb);
@@ -29,35 +33,44 @@ struct token *TBufUnGet(struct tokbuf *tb);
struct token *TBufReGet(struct tokbuf *tb);
struct token *TBufBack (struct tokbuf *tb, i32 n);
bool TBufDrop (struct tokbuf *tb, i32 t);
i32 TBufProc (struct token *tok);
i32 TBufProcL(struct token *tok);
void TBufErr (struct tokbuf *tb, cstr fmt, ...);
void TBufErrTk(struct tokbuf *tb, struct token *tok, cstr fmt, ...);
struct token *TBufExpc (struct tokbuf *tb, struct token *tok, i32 t1);
struct token *TBufExpc2(struct tokbuf *tb, struct token *tok, i32 t1, i32 t2);
struct token *TBufExpc3(struct tokbuf *tb, struct token *tok, i32 t1, i32 t2, i32 t3);
void TBufExpDr(struct tokbuf *tb, i32 t);

/* Types ------------------------------------------------------------------- */

enum
{
enum {
tokproc_next,
tokproc_done,
tokproc_skip
};

struct tokbuf
{
struct tokbuf {
__prop get {operator(): TBufGet (this)}
__prop peek {operator(): TBufPeek (this)}
__prop unget {operator(): TBufUnGet(this)}
__prop reget {operator(): TBufReGet(this)}
__prop back {operator(): TBufBack (this)}
__prop drop {operator(): TBufDrop (this)}
__prop err {operator(): TBufErr (this)}
__prop errtk {operator(): TBufErrTk(this)}
__prop expc {operator(): TBufExpc (this)}
__prop expc2 {operator(): TBufExpc2(this)}
__prop expc3 {operator(): TBufExpc3(this)}
__prop expdr {operator(): TBufExpDr(this)}

struct origin orig;

FILE *fp;

struct token *toks;
struct token toks[32];

i32 tpos, tend;
i32 bbeg, bend;

jmp_buf env;

i32 (*tokProcess)(struct token *tok);
};


+ 3
- 5
source/include/m_token.h View File

@@ -34,11 +34,6 @@ enum {
tok_quote, /* Quote */
tok_cmment, /* Comment */

/* Special (post-process) */
tok_keywrd, /* Keyword */
tok_numint, /* Integer Literal */
tok_numflt, /* Float Literal */

/* Single characters */
tok_lnend, /* \n */
tok_semico, /* ; */
@@ -120,5 +115,8 @@ struct token {
/* Extern Functions -------------------------------------------------------- */

void TokParse(FILE *fp, struct token *tok, struct origin *orig);
void TokPrint(struct token *tok);
bool TokIsKw(struct token *tok, cstr kw);
cstr TokType(i32 type);

#endif

+ 5
- 5
source/include/p_savedata.h View File

@@ -21,23 +21,23 @@
/* Ver. 7: Initial version. */
/* Ver. 14: Rewrite of save system. */
/* Ver. 15: Chunk format change. */
#define Ident_Lith FourCC('L', 'i', 't', 'h')
#define Ident_Lith FourCCPtr("Lith")
#define SaveV_Lith 15

/* Lend: Optional. Last valid chunk in save file. */
#define Ident_Lend FourCC('L', 'e', 'n', 'd')
#define Ident_Lend FourCCPtr("Lend")
#define SaveV_Lend 0

/* note: Notes. */
#define Ident_note FourCC('n', 'o', 't', 'e')
#define Ident_note FourCCPtr("note")
#define SaveV_note 0

/* agrp: Auto-groups. */
#define Ident_agrp FourCC('a', 'g', 'r', 'p')
#define Ident_agrp FourCCPtr("agrp")
#define SaveV_agrp 0

/* intr: Intros. */
#define Ident_intr FourCC('i', 'n', 't', 'r')
#define Ident_intr FourCCPtr("intr")
#define SaveV_intr 0

#define Save_VersMask 0x000000FF


+ 3
- 0
source/include/w_world.h View File

@@ -116,5 +116,8 @@ k32 AddAngle(i32 x, i32 y);
optargs(1) void FreezeTime(bool players_ok);
optargs(1) void UnfreezeTime(bool players_ok);
script void CBI_Install(i32 num);
script void F_Run(struct player *p);
void F_Load(void);
void F_Start(cstr which);

#endif

+ 37
- 58
source/m_file.c View File

@@ -11,7 +11,8 @@
* ---------------------------------------------------------------------------|
*/

#define _GNU_SOURCE /* Needed for fopencookie. See: man 7 feature_test_macros */
/* Needed for fopencookie. See: man 7 feature_test_macros */
#define _GNU_SOURCE

#include "common.h"
#include "m_file.h"
@@ -23,15 +24,13 @@

/* Type Definitions -------------------------------------------------------- */

struct memfile
{
struct memfile {
byte *mem;
size_t len;
size_t pos;
};

struct netfile
{
struct netfile {
anonymous struct memfile memfile;
str pcvar;
i32 pnum;
@@ -39,10 +38,10 @@ struct netfile

/* Static Functions -------------------------------------------------------- */

/* fclose for netfiles. */
/* Output to the CVar with a Base64 representation of the output buffer. */
static i32 NetClose(void *nfdata)
{
/* fclose for netfiles.
* Output to the CVar with a Base64 representation of the output buffer.
*/
static i32 NetClose(void *nfdata) {
struct netfile *nf = nfdata;

/* If debugging, print out information about the buffer being written. */
@@ -89,8 +88,7 @@ static i32 NetClose(void *nfdata)
return 0;
}

static ssize_t MemRead(void *memdata, char *buf, size_t size)
{
static ssize_t MemRead(void *memdata, char *buf, size_t size) {
struct memfile *mem = memdata;
size_t avail = mem->len - mem->pos;

@@ -102,13 +100,11 @@ static ssize_t MemRead(void *memdata, char *buf, size_t size)
return size;
}

static ssize_t MemWrite(void *memdata, cstr buf, size_t size)
{
static ssize_t MemWrite(void *memdata, cstr buf, size_t size) {
struct memfile *mem = memdata;
size_t avail = mem->len - mem->pos;

if(size >= avail)
{
if(size >= avail) {
size_t len = mem->len + mem->len / 2 + size + 1;
void *newmem = Ralloc(mem->mem, len);

@@ -124,8 +120,7 @@ static ssize_t MemWrite(void *memdata, cstr buf, size_t size)
return size;
}

static i32 MemSeek(void *memdata, off_t *offset, i32 whence)
{
static i32 MemSeek(void *memdata, off_t *offset, i32 whence) {
struct memfile *mem = memdata;
size_t pos;

@@ -143,34 +138,31 @@ static i32 MemSeek(void *memdata, off_t *offset, i32 whence)
return 0;
}

static i32 MemClose(void *memdata)
{
static i32 MemClose(void *memdata) {
struct memfile *mem = memdata;
Dalloc(mem->mem);
Dalloc(mem);

return 0;
}

/* Extern Functions -------------------------------------------------------- */

FILE *W_Open(str fname, cstr rw)
{
FILE *W_Open(str fname, cstr rw) {
str f;
ifw(i32 lmp = W_Find(fname), lmp == -1)

ifw(i32 lmp = ServCallI(sm_FindLump, fname), lmp == -1)
return nil;
else
f = W_Read(lmp);
f = ServCallS(sm_ReadLump, lmp);

return __fmemopen_str(f, ACS_StrLen(f), rw);
}

/* fopen() equivalent for netfiles. */
FILE *NFOpen(i32 pnum, str pcvar, char rw)
{
FILE *NFOpen(i32 pnum, str pcvar, char rw) {
FILE *fp = nil;

if(rw == 'w')
{
if(rw == 'w') {
struct netfile *nf = Salloc(struct netfile);

nf->pcvar = pcvar;
@@ -180,31 +172,27 @@ FILE *NFOpen(i32 pnum, str pcvar, char rw)
.write = MemWrite,
.close = NetClose
});
}
else if(rw == 'r')
{
} else if(rw == 'r') {
/* Get inputs from all possible CVars. */
char *input = nil;
size_t inputsz = 0;

for(i32 cvarnum;; cvarnum++)
{
str cvar = ACS_GetUserCVarString(pnum, StrParam("%S_%i", pcvar, cvarnum));
for(i32 cvarnum;; cvarnum++) {
str cvar =
ACS_GetUserCVarString(pnum, StrParam("%S_%i", pcvar, cvarnum));
size_t inlen = ACS_StrLen(cvar);

if(inlen)
{
if(inlen) {
input = Ralloc(input, inputsz + inlen + 1);
lstrcpy_str(input + inputsz, cvar);

inputsz += inlen;
}
else
} else {
break;
}
}

if(input)
{
if(input) {
/* Decode the base64 input. */
size_t size;
byte *data = base64_decode((void *)input, inputsz, &size);
@@ -212,8 +200,7 @@ FILE *NFOpen(i32 pnum, str pcvar, char rw)
Dalloc(input);

/* If debugging, print out information about the buffer being read. */
if(get_bit(dbgflag, dbgf_save))
{
if(get_bit(dbgflag, dbgf_save)) {
ACS_BeginLog();
__nprintf("NFOpen: Opening memfile \"%S\" (%zub)\nData follows\n",
pcvar, size);
@@ -221,8 +208,7 @@ FILE *NFOpen(i32 pnum, str pcvar, char rw)
ACS_EndLog();
}

if(data)
{
if(data) {
struct memfile *mem = Salloc(struct memfile);

mem->mem = data;
@@ -241,12 +227,10 @@ FILE *NFOpen(i32 pnum, str pcvar, char rw)
}

/* Unpacks integers into a file stream. */
size_t FWrite32(void const *restrict ptr, size_t count, size_t bytes, FILE *restrict fp)
{
size_t FWrite32(void const *restrict ptr, size_t count, size_t bytes, FILE *restrict fp) {
size_t res = 0;

for(byte const *itr = ptr; count--; res += bytes)
{
for(byte const *itr = ptr; count--; res += bytes) {
u32 c = *itr++;
for(i32 i = 0; i < bytes; i++)
if(fputc((c & (0xFF << (i * 8))) >> (i * 8), fp) == EOF)
@@ -257,8 +241,7 @@ size_t FWrite32(void const *restrict ptr, size_t count, size_t bytes, FILE *rest
}

/* Basic write function for bytes in a string. */
size_t FWriteStr(void const __str_ars *restrict ptr, size_t count, FILE *restrict fp)
{
size_t FWriteStr(void const __str_ars *restrict ptr, size_t count, FILE *restrict fp) {
size_t res = 0;

for(astr itr = ptr; count--; res++)
@@ -268,18 +251,14 @@ size_t FWriteStr(void const __str_ars *restrict ptr, size_t count, FILE *restric
}

/* Reads packed integers from a file stream. */
size_t FRead32(void *restrict buf, size_t count, size_t bytes, FILE *restrict fp)
{
size_t FRead32(void *restrict buf, size_t count, size_t bytes, FILE *restrict fp) {
size_t res = 0;

for(char *itr = buf; count--;)
{
for(char *itr = buf; count--;) {
i32 c = 0, t;

for(i32 i = 0; i < bytes; i++, res++)
{
if((t = fgetc(fp)) == EOF)
{
for(i32 i = 0; i < bytes; i++, res++) {
if((t = fgetc(fp)) == EOF) {
*itr = c;
return res;
}


+ 68
- 7
source/m_tokbuf.c View File

@@ -14,8 +14,14 @@
#include "m_tokbuf.h"
#include "m_str.h"

#include <ACS_ZDoom.h>
#include <string.h>

enum {
_bbeg = 14,
_bend = 28,
};

/* Extern Functions -------------------------------------------------------- */

i32 TBufProc(struct token *tok) {
@@ -39,26 +45,26 @@ i32 TBufProcL(struct token *tok) {

void TBufCtor(struct tokbuf *tb) {
tb->orig.line = 1;
tb->toks = Calloc(tb->bend, sizeof *tb->toks);

if(!tb->tokProcess) tb->tokProcess = TBufProc;
}

void TBufDtor(struct tokbuf *tb) {
if(tb->toks) for(i32 i = 0; i < tb->bend; i++) tb->toks[i].textC = 0;

Dalloc(tb->toks);
for(i32 i = 0; i < _bend; i++) {
tb->toks[i].type = 0;
tb->toks[i].textC = 0;
}
}

struct token *TBufGet(struct tokbuf *tb) {
if(++tb->tpos < tb->tend) return &tb->toks[tb->tpos];

/* free beginning of buffer */
for(i32 i = 0; i < tb->bbeg; i++) tb->toks[i].textC = 0;
for(i32 i = 0; i < _bbeg; i++) tb->toks[i].textC = 0;

/* move end of buffer to beginning */
if(tb->tend) {
i32 s = tb->tend - tb->bbeg;
i32 s = tb->tend - _bbeg;

for(i32 i = s, j = 0; i < tb->tend; i++, j++)
tb->toks[j] = tb->toks[i];
@@ -67,7 +73,7 @@ struct token *TBufGet(struct tokbuf *tb) {
}

/* get new tokens */
for(tb->tpos = tb->tend = tb->bbeg; tb->tend < tb->bend; tb->tend++) {
for(tb->tpos = tb->tend = _bbeg; tb->tend < _bend; tb->tend++) {
skip:
TokParse(tb->fp, &tb->toks[tb->tend], &tb->orig);

@@ -108,4 +114,59 @@ bool TBufDrop(struct tokbuf *tb, i32 t) {
}
}

void TBufErr(struct tokbuf *tb, cstr fmt, ...) {
va_list vl;

ACS_BeginPrint();
va_start(vl, fmt);
__vnprintf(fmt, vl);
va_end(vl);
ACS_EndLog();

longjmp(tb->env, 1);
}

void TBufErrTk(struct tokbuf *tb, struct token *tok, cstr fmt, ...) {
va_list vl;

ACS_BeginPrint();
TokPrint(tok);
ACS_PrintChar(' ');
va_start(vl, fmt);
__vnprintf(fmt, vl);
va_end(vl);
ACS_EndLog();

longjmp(tb->env, 1);
}

struct token *TBufExpc(struct tokbuf *tb, struct token *tok, i32 t1) {
if(tok->type != t1) {
tb->errtk(tok, "expected %s", TokType(t1));
}
return tok;
}

struct token *TBufExpc2(struct tokbuf *tb, struct token *tok, i32 t1, i32 t2) {
if(tok->type != t1 && tok->type != t2) {
tb->errtk(tok, "expected %s or %s", TokType(t1), TokType(t2));
}
return tok;
}

struct token *TBufExpc3(struct tokbuf *tb, struct token *tok, i32 t1, i32 t2, i32 t3) {
if(tok->type != t1 && tok->type != t2 && tok->type != t3) {
tb->errtk(tok, "expected %s, %s, or %s", TokType(t1),
TokType(t2), TokType(t3));
}
return tok;
}

void TBufExpDr(struct tokbuf *tb, i32 t) {
if(!tb->drop(t)) {
struct token *tok = tb->reget();
tb->errtk(tok, "expected %s", TokType(t));
}
}

/* EOF */

+ 81
- 1
source/m_token.c View File

@@ -15,6 +15,7 @@
#include "m_vec.h"
#include "m_char.h"
#include "m_file.h"
#include "m_str.h"

#define textNext() tok->textV[tok->textC++]

@@ -123,7 +124,6 @@ begin:;
}

advLine();
textNext() = ch;
}

unget();
@@ -183,4 +183,84 @@ begin:;
}
}

void TokPrint(struct token *tok) {
__nprintf("[%i:%i](%s (%i) '%.*s')", tok->orig.line,
tok->orig.colu, TokType(tok->type), tok->type,
tok->textC, tok->textV);
}

bool TokIsKw(struct token *tok, cstr kw) {
return tok->type == tok_identi && faststrcmp(tok->textV, kw) == 0;
}

cstr TokType(i32 type) {
switch(type) {
case tok_null: return "null-token";
case tok_chrseq: return "character-sequence";
case tok_identi: return "identifier";
case tok_number: return "number";
case tok_string: return "string-double";
case tok_charac: return "string-single";
case tok_quote: return "string-quote";
case tok_cmment: return "comment";
case tok_lnend: return "new-line";
case tok_semico: return "`;'";
case tok_comma: return "`,'";
case tok_hash: return "`#'";
case tok_bracko: return "`['";
case tok_brackc: return "`]'";
case tok_braceo: return "`{'";
case tok_bracec: return "`}'";
case tok_pareno: return "`('";
case tok_parenc: return "`)'";
case tok_eq: return "`='";
case tok_eq2: return "`=='";
case tok_tern: return "`?'";
case tok_terneq: return "`?='";
case tok_div: return "`/'";
case tok_diveq: return "`/='";
case tok_not: return "`!'";
case tok_neq: return "`!='";
case tok_bnot: return "`~'";
case tok_bneq: return "`~='";
case tok_mul: return "`*'";
case tok_muleq: return "`*='";
case tok_at: return "`@'";
case tok_at2: return "`@@'";
case tok_lt: return "`<'";
case tok_lt2: return "`<<'";
case tok_le: return "`<='";
case tok_gt: return "`>'";
case tok_gt2: return "`>>'";
case tok_ge: return "`>='";
case tok_or: return "`|'";
case tok_or2: return "`||'";
case tok_oreq: return "`|='";
case tok_and: return "`&'";
case tok_and2: return "`&&'";
case tok_andeq: return "`&='";
case tok_add: return "`+'";
case tok_add2: return "`++'";
case tok_addeq: return "`+='";
case tok_sub: return "`-'";
case tok_sub2: return "`--'";
case tok_subeq: return "`-='";
case tok_mod: return "`%'";
case tok_mod2: return "`%%'";
case tok_modeq: return "`%='";
case tok_xor: return "`^'";
case tok_xor2: return "`^^'";
case tok_xoreq: return "`^='";
case tok_col: return "`:'";
case tok_col2: return "`::'";
case tok_coleq: return "`:='";
case tok_dot: return "`.'";
case tok_dot2: return "`..'";
case tok_dot3: return "`...'";
case tok_rarrow: return "`->'";
case tok_eof: return "end-of-file";
}
return "invalid-token";
}

/* EOF */

+ 2
- 3
source/p_bip.c View File

@@ -17,7 +17,6 @@
#include "m_list.h"
#include "w_world.h"
#include "m_file.h"
#include "m_tokbuf.h"

/* Static Functions -------------------------------------------------------- */

@@ -76,8 +75,8 @@ static u32 NameToNum(cstr discrim, cstr name) {
for(u32 i = 0; i < BIP_MAX; i++) {
bip_name_t tag;
lstrcpy2(tag, name, discrim);
if(!faststrcmp(bipinfo[i].name, tag) ||
!faststrcmp(bipinfo[i].name, name)) {
if(faststrcmp(bipinfo[i].name, tag) == 0 ||
faststrcmp(bipinfo[i].name, name) == 0) {
return i;
}
}


+ 354
- 0
source/w_finale.c View File

@@ -0,0 +1,354 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.