Skip to content

Commit

Permalink
Add Startup, Add LockDef handling via Preprocessor, Light updates to …
Browse files Browse the repository at this point in the history
…Paladin and Demoness
  • Loading branch information
Lemon-King committed Oct 30, 2023
1 parent 1c641e3 commit 73231e5
Show file tree
Hide file tree
Showing 13 changed files with 248 additions and 56 deletions.
Binary file added resources/assets/NOTCH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/assets/STARTUP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 62 additions & 3 deletions resources/assets/lockdefs.hxdd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,68 @@ Lock 228
//

//
// Heretic / Hexen KeyDefs
// Heretic Key Defs
//

Lock 1001
{
//$Title "Green key"
//KeyGreen
KeyGreen
Message "$TXT_NEEDGREENKEY"
Mapcolor 0 255 0
}


Lock 1002
{
//$Title "Blue key"
//KeyBlue
KeyBlue
Message "$TXT_NEEDBLUEKEY"
Mapcolor 0 0 255
}


Lock 1003
{
//$Title "Yellow key"
//KeyYellow
KeyYellow
Message "$TXT_NEEDYELLOWKEY"
Mapcolor 255 255 0
}

//
// Hexen Key Defs
//

Lock 2001
{
//$Title "Steel key"
KeySteel
Message "$TXT_NEED_KEY_STEEL"
Mapcolor 150 150 150
}

Lock 2002
{
//$Title "Cave key"
KeyCave
Message "$TXT_NEED_KEY_CAVE"
Mapcolor 255 218 0
}

Lock 2003
{
//$Title "Axe key"
KeyAxe
Message "$TXT_NEED_KEY_AXE"
Mapcolor 64 64 255
}

//
// Shared Key Defs
//

Lock 1
Expand Down Expand Up @@ -57,8 +118,6 @@ Lock 3
Mapcolor 255 255 0
}



Lock 4
{
//$Title "Fire key"
Expand Down
13 changes: 7 additions & 6 deletions resources/assets/zscript/actors/hxdd/hexen2/_hexen2.zs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "zscript/actors/hxdd/hexen2/spritefx/_spritefx.zs"

// Hexen 2 Player Classes
#include "zscript/actors/hxdd/hexen2/players/_shared.zs"
#include "zscript/actors/hxdd/hexen2/players/paladinplayer.zs"
#include "zscript/actors/hxdd/hexen2/players/crusaderplayer.zs"
#include "zscript/actors/hxdd/hexen2/players/assassinplayer.zs"
Expand All @@ -18,10 +19,10 @@
#include "zscript/actors/hxdd/hexen2/weapons/weaponbase.zs"

// Paladin Weapons
#include "zscript/actors/hxdd/hexen2/weapons/paladingauntlets.zs" // NEEDS POWERED, POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinvorpalsword.zs" // NEEDS POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinaxe.zs" // NEEDS POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinpurifier.zs" // NEEDS HOMING TUNING, POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladingauntlets.zs" // NEEDS GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinvorpalsword.zs" // NEEDS GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinaxe.zs" // NEEDS GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/paladinpurifier.zs" // NEEDS HOMING TUNING, GL LIGHTING, ICON

// Crusader Weapons
#include "zscript/actors/hxdd/hexen2/weapons/crusaderwarhammer.zs" // NEEDS POWERED, POLISH PASS, GL LIGHTING, ICON
Expand All @@ -41,10 +42,10 @@
#include "zscript/actors/hxdd/hexen2/weapons/assassinstaffofset.zs" // NEEDS IMPLEMENTION

// Succubus Weapons
#include "zscript/actors/hxdd/hexen2/weapons/succubusbloodrain.zs" // NEEDS POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/succubusbloodrain.zs" // NEEDS POWERED, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/succubusacidrune.zs" // NEEDS POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/succubusfirestorm.zs" // NEEDS POLISH PASS, GL LIGHTING, ICON
#include "zscript/actors/hxdd/hexen2/weapons/succubustempteststaff.zs" // NEEDS IMPLEMENTION
#include "zscript/actors/hxdd/hexen2/weapons/succubustempeststaff.zs" // NEEDS IMPLEMENTION

// Inventory
#include "zscript/actors/hxdd/hexen2/inventory/pickups.zs"
Expand Down
35 changes: 35 additions & 0 deletions resources/assets/zscript/actors/hxdd/hexen2/players/_shared.zs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class HX2PlayerHead : PlayerChunk {
vector3 avelocity;

Default {
Radius 4;
Height 4;
Gravity 0.25;
+NOBLOCKMAP
+DROPOFF
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
}
States {
Spawn:
HX2H A 1 A_CheckFloor("Hit");
Loop;
Hit:
HX2H A 16 A_CheckPlayerDone;
Stop;
}

override void BeginPlay() {
self.avelocity = LemonUtil.GetRandVector3((-6.25, -6.25, -6.25), (6.25, 6.25, 6.25));
}

override void Tick() {
Super.Tick();

self.angle += self.avelocity.x;
self.pitch += self.avelocity.y;
self.roll += self.avelocity.z;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class HX2PaladinPlayer : HXDDHexenIIPlayerPawn {
//PLAY N -1;
Stop;
XDeath:
PDDA A 2 A_SkullPop("HX2PaladinPlayer_Head");
PDDA A 2 A_SkullPop("HX2PaladinPlayerHead");
PDDA BCDEFGHIJKLMNOPQRSTUVWXYZ 2;
PDDB A 2;
PDDB B -1;
Expand Down Expand Up @@ -193,24 +193,4 @@ class HX2PaladinPlayer : HXDDHexenIIPlayerPawn {
}
}

class HX2PaladinPlayer_Head : PlayerChunk {
Default {
Radius 4;
Height 4;
Gravity 0.125;
+NOBLOCKMAP
+DROPOFF
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
}
States {
Spawn:
PHED A 1 A_CheckFloor("Hit");
Loop;
Hit:
PHED A 16 A_CheckPlayerDone;
Stop;
}
}
class HX2PaladinPlayerHead : HX2PlayerHead {}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class HX2SuccubusPlayer : HXDDHexenIIPlayerPawn
//PLAY N -1;
Stop;
XDeath:
PDDA A 2 A_SkullPop("HX2SuccubusPlayer_Head");
PDDA A 2 A_SkullPop("HX2SuccubusPlayerHead");
PDDA BCDEFGHIJKLMNOPQRSTUVWXYZ 2;
PDDB A 2;
PDDB B -1;
Expand Down Expand Up @@ -198,24 +198,4 @@ class HX2SuccubusPlayer : HXDDHexenIIPlayerPawn
}
}

class HX2SuccubusPlayer_Head : PlayerChunk {
Default {
Radius 4;
Height 4;
Gravity 0.125;
+NOBLOCKMAP
+DROPOFF
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
}
States {
Spawn:
PSHD A 1 A_CheckFloor("Hit");
Loop;
Hit:
PSHD A 16 A_CheckPlayerDone;
Stop;
}
}
class HX2SuccubusPlayerHead : HX2PlayerHead {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// Paladin Weapon: Acid Rune
// https://github.com/videogamepreservation/hexen2/blob/master/H2MP/hcode/acidorb.hc
// lighting: https://github.com/videogamepreservation/hexen2/blob/eac5fd50832ce2509226761b3b1a387c468e7a50/H2MP/code/CL_MAIN.C#L727

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Demoness Weapon: Blood Rain

class SWeapBloodRain : SuccubusWeapon {
Default {
Expand Down Expand Up @@ -76,6 +77,8 @@ class SWeapBloodRain_Missile : Actor
Vector3 start;

Default {
RenderStyle "Add";

+HITTRACER;
+ZDOOMTRANS;
+SPAWNSOUNDSOURCE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// Demoness Weapon: Firestorm
// https://github.com/videogamepreservation/hexen2/blob/master/H2MP/hcode/flameorb.hc

class SWeapFireStorm: SuccubusWeapon {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Demoness Weapon: Temptest Staff
// https://github.com/videogamepreservation/hexen2/blob/master/H2MP/hcode/lightwp.hc

class SWeapTempestStaff: SuccubusWeapon {
bool lastPoweredState;

Default {
+BLOODSPLATTER;
+FLOATBOB;

Weapon.SelectionOrder 1000;
Weapon.AmmoType1 "Mana1";
Weapon.AmmoType2 "Mana2";
Weapon.AmmoUse1 1;
Weapon.AmmoUse2 1;
Weapon.AmmoGive 150;
Weapon.KickBack 150;
//Weapon.YAdjust 10;
Obituary "$OB_MPSWEAPTEMPESTSTAFF";
Tag "$TAG_SWEAPTEMPESTSTAFF";
}

States {
Spawn:
PKUP A -1;
Stop;
/*
Select:
500A A 0 A_Select;
Loop;
Deselect:
500A A 0 A_Deselect;
Loop;
Select_Normal:
FSSN KJIHGFEDCBA 2 Offset(0, 32);
TNT1 A 0 A_Raise(100);
Goto Ready;
Select_Power:
FSSP ABCDEFGHIJK 2 Offset(0, 32);
TNT1 A 0 A_Raise(100);
Goto Ready_Power;
Deselect_Normal:
FSIA A 0;
FSSN ABCDEFGHIJK 2;
TNT1 A 0 A_Lower(100);
Loop;
Deselect_Power:
FSIC A 0;
FSSP KJIHGFEDCBA 2;
TNT1 A 0 A_Lower(100);
Loop;
Ready:
FSIA ABCDEFGHIJKLMNOPQRSTUVWX 2 A_FireStormReady;
FSIA Y 2 A_FireStormReady(true);
Loop;
*/
}
}
3 changes: 2 additions & 1 deletion resources/assets/zscript/events/_events.zs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "zscript/events/hxdd/worldhandler.zs"
#include "zscript/events/hxdd/worldhandler.zs"
#include "zscript/events/hxdd/postprocessor.zs"
75 changes: 75 additions & 0 deletions resources/assets/zscript/events/hxdd/postprocessor.zs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Class HXDDLevelCompatibility : LevelPostProcessor {
// ref: https://github.com/jekyllgrim/Beautiful-Doom/blob/53974b963c5f85c904808e7069a6b2d91bb5dd00/Z_BDoom/bd_events.zc#L66
int GetLineLockNumber(Line l) {
if ( !l.locknumber ) {
// check the special
switch ( l.special ) {
case FS_Execute:
return l.Args[2];
break;
case Door_LockedRaise:
case Door_Animated:
return l.Args[3];
break;
case ACS_LockedExecute:
case ACS_LockedExecuteDoor:
case Generic_Door:
return l.Args[4];
break;
}
}
return l.locknumber;
}

protected void Apply(Name checksum, String mapname) {
// HXDD Mode only modifies 6 keys, so we should be looking for those keys in lines
if (LemonUtil.CVAR_GetBool("HXDD_USE_KEYDEF_MODE", true)) {
int gameMode = LemonUtil.GetOptionGameMode();
int offset = 0;
if (gameMode == GAME_Heretic) {
offset = 1000;
} else if (gameMode == GAME_Hexen) {
offset = 2000;
}
for (int i = 0; i < Level.lines.Size(); i++) {
Line l = Level.lines[i];
int locknum = GetLineLockNumber(l);
if (locknum > 0) {
Array<int> args;
args.Resize(l.Args.Size());
for (int i = 0; i < l.Args.Size(); i++) {
args[i] = l.Args[i];
}
if ( !l.locknumber ) {
// check the special
int key;
switch ( l.special ) {
case FS_Execute:
key = args[2] - 128;
if (key > 0 && key < 4) {
args[2] = key + offset;
}
break;
case Door_LockedRaise:
case Door_Animated:
key = args[3] - 128;
if (key > 0 && key < 4) {
args[3] = key + offset;
}
break;
case ACS_LockedExecute:
case ACS_LockedExecuteDoor:
case Generic_Door:
key = args[4] - 128;
if (key > 0 && key < 4) {
args[4] = key + offset;
}
break;
}
}
SetLineSpecial(i, l.special, args[0], args[1], args[2], args[3], args[4]);
}
}
}
}
}

0 comments on commit 73231e5

Please sign in to comment.