Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

re-init

  • Loading branch information...
commit c0505b922f1835707db5ae4761f19076917b2609 0 parents
@IjonTichy authored
4 .gitignore
@@ -0,0 +1,4 @@
+*.o
+*.zip
+*.pk3
+*.sw?
1  packagepk3.py
4 pk3/DECORATE.dec
@@ -0,0 +1,4 @@
+#define LEVEL_ADDXP 481
+#define LEVEL_ADDXP_ONKILL 489
+
+#include {decorate}
3  pk3/KEYCONF.txt
@@ -0,0 +1,3 @@
+clearplayerclasses
+
+addplayerclass UnlockPlayer
1  pk3/LOADACS.txt
@@ -0,0 +1 @@
+level
762 pk3/acs/level.c
@@ -0,0 +1,762 @@
+#include "zcommon.acs"
+#library "level"
+
+#include "unlockNames.h"
+#include "unlockFuncs.h"
+#include "unlocks.h"
+
+
+global int 3:inGame[];
+global int 4:unlocksLeft[];
+global int 6:unlocksPerPlayer[];
+
+// Layout: [hp, speed, jumpz, level, xp, next levelup, weapons, ...]
+global int 5:startStats[];
+
+int uMenuLock[32];
+int hasEntered[32];
+
+function int getName(int num)
+{
+ return unlockNames[num];
+}
+
+function int getMax(int num)
+{
+ return unlockables[num][8];
+}
+
+function int getUnlock(int pln, int num)
+{
+ int i = (pln * UNLOCK_COUNT) + num;
+ return unlocksPerPlayer[i];
+}
+
+function void setUnlock(int pln, int num, int value)
+{
+ int i = (pln * UNLOCK_COUNT) + num;
+ unlocksPerPlayer[i] = value;
+}
+
+function void addUnlock(int pln, int num, int value)
+{
+ int i = (pln * UNLOCK_COUNT) + num;
+ unlocksPerPlayer[i] += value;
+}
+
+function void applyUnlock(int pln, int num)
+{
+ int s = unlockables[num][0];
+
+ if (s == -1)
+ {
+ return;
+ }
+ else if (s < 0 || s > 999)
+ {
+ Log(s:"ERROR: Unlock \"", s:getName(num), s:"\" has apply script ", d:s, s:", which makes no sense");
+ }
+
+ int a1 = unlockables[num][1];
+ int a2 = unlockables[num][2];
+ int a3 = unlockables[num][3];
+
+ ACS_ExecuteAlways(s, 0, a1,a2,a3);
+}
+
+function void unlockUnlock(int pln, int num)
+{
+ if (!checkUnlock(pln, num, 0))
+ {
+ return;
+ }
+
+ int s = unlockables[num][4];
+
+ if (s < 0 || s > 999)
+ {
+ Log(s:"ERROR: Unlock \"", s:getName(num), s:"\" has unlock script ", d:s, s:", which makes no sense");
+ return;
+ }
+
+ int a1 = unlockables[num][5];
+ int a2 = unlockables[num][6];
+ int a3 = unlockables[num][7];
+
+ addUnlock(pln, num, 1);
+
+ ACS_ExecuteAlways(s, 0, a1,a2,a3);
+}
+
+function int checkUnlock(int pln, int num, int quiet)
+{
+ int s = unlockables[num][9];
+
+ if (getMax(num) <= getUnlock(pln, num) && getMax(num) != -1 )
+ {
+ if (!quiet)
+ {
+ Print(s:"\caAlready at max level (\cd", d:getMax(num), s:"\ca) for \ck\"", s:getName(num), s:"\"\ca");
+ }
+ return false;
+ }
+
+ if (s == -1)
+ {
+ return true;
+ }
+ else if (s < 0 || s > 999)
+ {
+ Log(s:"ERROR: Unlock \"", s:getName(num), s:"\" has check script ", d:s, s:", which makes no sense");
+ return false;
+ }
+
+ int a1 = unlockables[num][10];
+ int a2 = unlockables[num][11];
+ int a3 = unlockables[num][12];
+
+ if (quiet) // Assume negative a2 means 'quiet'
+ {
+ a2 = -a2;
+ }
+
+ int ret = ACS_ExecuteWithResult(s, a1,a2,a3);
+
+ return ret;
+}
+
+
+function int getStat(int pln, int which)
+{
+ return startStats[(pln * STAT_COUNT) + which];
+}
+
+function void setStat(int pln, int which, int value)
+{
+ startStats[(pln * STAT_COUNT) + which] = value;
+}
+
+function void addStat(int pln, int which, int value)
+{
+ startStats[(pln * STAT_COUNT) + which] += value;
+}
+
+
+
+
+
+script UNLOCK_ENTER enter
+{
+ int pln = PlayerNumber();
+ int i; int weps; int wepName;
+
+ hasEntered[pln] = 1;
+
+ if (!inGame[pln])
+ {
+ inGame[pln] = 1;
+ int hp = GetActorProperty(0, APROP_SpawnHealth);
+
+ if (hp != 0)
+ {
+ setStat(pln, STAT_HP, hp);
+ }
+ else
+ {
+ setStat(pln, STAT_HP, 100);
+ SetActorProperty(0, APROP_SpawnHealth, 100);
+ }
+
+ setStat(pln, STAT_SPEED, GetActorProperty(0, APROP_Speed));
+ setStat(pln, STAT_JUMPZ, GetActorProperty(0, APROP_JumpZ));
+ setStat(pln, STAT_XP, 0);
+ setStat(pln, STAT_LEVEL, 1);
+ setStat(pln, STAT_NEXTL, 50);
+ setStat(pln, STAT_HP_REGENRATE, 0);
+ setStat(pln, STAT_AMMO_REGENRATE, 0);
+
+ for (i = 0; i < UNLOCK_WEPCOUNT; i++)
+ {
+ wepName = unlockWeapons[i];
+
+ if (CheckInventory(wepName))
+ {
+ weps |= pow(2, i);
+ }
+ }
+ setStat(pln, STAT_WEPS, weps);
+
+ for (i = 0; i < UNLOCK_COUNT; i++)
+ {
+ setUnlock(pln, i, 0);
+ }
+ }
+
+ ACS_ExecuteAlways(UNLOCK_LEVELHUD, 0, 0,0,0);
+ ACS_ExecuteAlways(UNLOCK_REGEN, 0, 0,0,0);
+}
+
+script UNLOCK_RESPAWN respawn
+{
+ int i;
+ int pln = PlayerNumber();
+
+ if (!hasEntered[pln]) // wasn't in the game - do ENTER
+ {
+ ACS_ExecuteAlways(UNLOCK_ENTER, 0, 0,0,0);
+ }
+
+ if (GetActorProperty(0, APROP_SpawnHealth) == 0)
+ {
+ SetActorProperty(0, APROP_SpawnHealth, 100);
+ }
+
+ for (i = 0; i < UNLOCK_COUNT; i++)
+ {
+ applyUnlock(pln, i);
+ }
+}
+
+script UNLOCK_DISCONNECT (int pln) disconnect
+{
+ int i;
+ for (i = 0; i < STAT_COUNT; i++)
+ {
+ setStat(pln, i, 0);
+ }
+}
+
+script UNLOCK_MENU (void)
+{
+ int pln = PlayerNumber();
+
+ if (uMenuLock[pln])
+ {
+ terminate;
+ }
+
+ SetHudSize(640, 480, 1);
+
+ uMenuLock[pln] = 1;
+ GiveInventory("SpawnStop", 1);
+ GiveInventory("SpawnProtection", 1);
+
+ int i; int tic; int selected; int oSelected; int left; int oLeft;
+ int name; int l_max; int current;
+ int msgColor; int nameColor;
+ int oneUnlocked; int startloop;
+
+ int usekey; int upkey; int downkey;
+
+ for (i = 0; i < UNLOCK_COUNT; i++)
+ {
+ if (getUnlock(pln, i) < getMax(i))
+ {
+ startloop = 1;
+ break;
+ }
+ }
+
+ // Mainloop
+ while (startloop)
+ {
+ if (PlayerIsBot(pln))
+ {
+ break;
+ }
+ if (keyPressed(BT_JUMP))
+ {
+ break;
+ }
+
+ if (keyDown(BT_USE))
+ {
+ if (usekey == -1)
+ {
+ usekey = MENU_USESPEED;
+
+ if (checkUnlock(pln, selected, 0))
+ {
+ unlocksLeft[pln]--;
+
+ unlockUnlock(pln, selected);
+
+ name = getName(selected);
+ l_max = getMax(selected);
+ current = getUnlock(pln, selected);
+
+ if (l_max == -1)
+ {
+ HudMessage(s:nameColor, s:name, s:"\c- (Current: \cd", d:current, s:"\c-)";
+ HUDMSG_FADEOUT, UNLOCK_HBASE + selected, CR_BRICK, (100.0 * (selected / 30)) + 80.1, (15.0 * (selected % 30)) + 80.1, 2.0, 2.0);
+ }
+ else
+ {
+ HudMessage(s:nameColor, s:name, s:"\c- (Max: \cf", d:l_max, s:"\c-, current: \cd", d:current, s:"\c-)";
+ HUDMSG_FADEOUT, UNLOCK_HBASE + selected, CR_BRICK, (100.0 * (selected / 30)) + 80.1, (15.0 * (selected % 30)) + 80.1, 2.0, 2.0);
+ }
+ }
+ }
+ }
+ else
+ {
+ usekey = 0;
+ }
+
+ if (keyDown(BT_FORWARD))
+ {
+ if (upkey == -1)
+ {
+ upkey = MENU_UPSPEED;
+ }
+ }
+ else
+ {
+ upkey = 0;
+ }
+
+ if (keyDown(BT_BACK))
+ {
+ if (downkey == -1)
+ {
+ downkey = MENU_DOWNSPEED;
+ }
+ }
+ else
+ {
+ downkey = 0;
+ }
+
+ SetPlayerProperty(0, 1, PROP_FROZEN);
+
+ left = unlocksLeft[pln];
+
+ selected -= (upkey / MENU_UPSPEED);
+ selected += (downkey / MENU_DOWNSPEED);
+
+ selected = mod(selected, UNLOCK_COUNT);
+
+ if (tic % MENU_REFRESH == 0 || oSelected != selected || oLeft != left)
+ {
+ tic = 0;
+ oneUnlocked = 0;
+
+ SetFont("BIGFONT");
+
+ HudMessage(s:"\cfLEVEL UP\c- - \cd", d:left, s:"\c- left";
+ HUDMSG_FADEOUT, UNLOCK_HBASE - 1, CR_WHITE, 77.3, 34.1, ((MENU_REFRESH << 16) / 35) + 2.0, 2.0);
+
+ SetFont("SMALLFONT");
+
+ for (i = 0; i < UNLOCK_COUNT; i++)
+ {
+ if (selected == i)
+ {
+ msgColor = CR_BRICK;
+ }
+ else
+ {
+ msgColor = CR_DARKGREY;
+ }
+
+ if (checkUnlock(pln, i, 1))
+ {
+ nameColor = "\ck";
+ }
+ else
+ {
+ nameColor = "\cm";
+ }
+
+ name = getName(i);
+ l_max = getMax(i);
+ current = getUnlock(pln, i);
+
+ if (current < l_max || l_max == -1)
+ {
+ oneUnlocked = 1;
+ }
+
+ if (l_max == -1)
+ {
+ HudMessage(s:nameColor, s:name, s:"\c- (Current: \cd", d:current, s:"\c-)";
+ HUDMSG_FADEOUT, UNLOCK_HBASE + i, msgColor, (75.0 * (i / 30)) + 80.1, (11.0 * (i % 30)) + 60.1,
+ ((MENU_REFRESH << 16) / 35) + 2.0, 2.0);
+ }
+ else
+ {
+ HudMessage(s:nameColor, s:name, s:"\c- (Max: \cf", d:l_max, s:"\c-, current: \cd", d:current, s:"\c-)";
+ HUDMSG_FADEOUT, UNLOCK_HBASE + i, msgColor, (75.0 * (i / 30)) + 80.1, (11.0 * (i % 30)) + 60.1,
+ ((MENU_REFRESH << 16) / 35) + 2.0, 2.0);
+ }
+ HudMessage(s:"\cf", k:"+forward", s:"\c- scrolls down, \cf", k:"+back", s:"\c- up, \cf",
+ k:"+use", s:"\c- selects, \cf", k:"+jump", s:"\c- exits";
+ HUDMSG_FADEOUT, UNLOCK_HBASE - 2, CR_GREEN, 320.4, 460.2,
+ ((MENU_REFRESH << 16) / 35) + 2.0, 2.0);
+ }
+ }
+
+
+ tic++;
+ oLeft = left;
+ oSelected = selected;
+
+ if (!left || !oneUnlocked)
+ {
+ break;
+ }
+ usekey--; upkey--; downkey--;
+ Delay(1);
+ }
+
+ if (PlayerIsBot(pln))
+ {
+ while (unlocksLeft[pln] != 0)
+ {
+ selected = Random(0, UNLOCK_COUNT);
+
+ while (!checkUnlock(pln, selected, 1))
+ {
+ selected = Random(0, UNLOCK_COUNT);
+ }
+
+ unlocksLeft[pln]--;
+ unlockUnlock(pln, selected);
+ }
+ }
+
+
+ GiveInventory("EndSpawnProtection", 1);
+ uMenuLock[pln] = 0;
+
+
+}
+
+
+script UNLOCK_LEVELHUD (void)
+{
+ int pln = PlayerNumber();
+ int tic;
+ int xp; int oXp;
+ int level; int oLevel;
+ int nextLevel; int oNextLevel;
+
+ SetHudSize(640, 480, 1);
+
+ while (PlayerInGame(pln))
+ {
+ oXp = xp;
+ xp = getStat(pln, STAT_XP);
+
+ oLevel = level;
+ level = getStat(pln, STAT_LEVEL);
+
+ oNextLevel = nextLevel;
+ nextLevel = getStat(pln, STAT_NEXTL);
+
+ if ((tic % HUD_REFRESH) == 0 || (xp != oXp) || (level != oLevel) || (nextLevel != oNextLevel))
+ {
+ SetFont("BIGFONT");
+ HudMessage(s:"Level \ck", d:level;
+ HUDMSG_FADEOUT, UNLOCK_HBASE2 + 1, CR_GREY, 580.2, 110.2, ((HUD_REFRESH << 16) / 35) + 2.0, 2.0);
+
+ SetFont("SMALLFONT");
+ HudMessage(s:"XP: \cd", d:xp, s:"\cf/\cd", d:nextLevel;
+ HUDMSG_FADEOUT, UNLOCK_HBASE2 + 2, CR_WHITE, 590.2, 130.2, ((HUD_REFRESH << 16) / 35) + 2.0, 2.0);
+
+ tic = 0;
+ }
+
+ tic++;
+ Delay(1);
+ }
+}
+
+script UNLOCK_REGEN (void)
+{
+ int pln = PlayerNumber();
+ int tic;
+ int aRegenRate; int hRegenRate;
+
+ int hpRate; int clipRate; int shellRate; int rocketRate; int cellRate;
+ int hpGet; int clipGet; int shellGet; int rocketGet; int cellGet;
+
+ while (PlayerInGame(pln))
+ {
+ hRegenRate = getStat(pln, STAT_HP_REGENRATE);
+ aRegenRate = getStat(pln, STAT_AMMO_REGENRATE);
+
+ hpRate += hRegenRate;
+ hpGet = hpRate / HEALTH_REGENRATE;
+
+ clipRate += aRegenRate; clipGet = clipRate / AMMO_CLIPRATE;
+ shellRate += aRegenRate; shellGet = shellRate / AMMO_SHELLRATE;
+ rocketRate += aRegenRate; rocketGet = rocketRate / AMMO_ROCKETRATE;
+ cellRate += aRegenRate; cellGet = cellRate / AMMO_CELLRATE;
+
+ hpRate = mod(hpRate, HEALTH_REGENRATE);
+ clipRate = mod(clipRate, AMMO_CLIPRATE);
+ shellRate = mod(shellRate, AMMO_SHELLRATE);
+ rocketRate = mod(rocketRate, AMMO_ROCKETRATE);
+ cellRate = mod(cellRate, AMMO_CELLRATE);
+
+ GiveInventory("Clip", clipGet);
+ GiveInventory("Shell", shellGet);
+ GiveInventory("RocketAmmo", rocketGet);
+ GiveInventory("Cell", cellGet);
+
+ HealThing(hpGet);
+ delay(1);
+ }
+}
+
+script LEVEL_ADDXP (int pln, int addXP)
+{
+ if (pln == -1)
+ {
+ pln = PlayerNumber();
+ }
+
+ addStat(pln, STAT_XP, addXP);
+ addStat(pln, STAT_TOTALXP, addXP);
+ ACS_ExecuteAlways(LEVEL_RECALC, 0, pln, 0,0);
+}
+
+script LEVEL_RECALC (int pln)
+{
+ int xp = getStat(pln, STAT_XP);
+ int level = getStat(pln, STAT_LEVEL);
+ int next = getStat(pln, STAT_NEXTL);
+ int leveled;
+
+ while (xp > next)
+ {
+ xp -= next;
+
+ level++;
+ leveled++;
+ unlocksLeft[pln]++;
+
+ next += 25;
+ }
+
+ if (leveled)
+ {
+ ACS_ExecuteAlways(UNLOCK_MENU, 0, 0,0,0);
+ }
+
+ setStat(pln, STAT_XP, xp);
+ setStat(pln, STAT_LEVEL, level);
+ setStat(pln, STAT_NEXTL, next);
+}
+
+script LEVEL_ADDXP_ONKILL (int isMonster, int amount)
+{
+ int killedHP = GetActorProperty(0, APROP_SpawnHealth); // in case monster
+ int killedPln = PlayerNumber();
+ int killedTeam = GetPlayerInfo(killedPln, PLAYERINFO_TEAM);
+
+ SetActivatorToTarget(0);
+
+ int killerPln = PlayerNumber();
+ int killerTeam = GetPlayerInfo(killerPln, PLAYERINFO_TEAM);
+
+ if (!amount)
+ {
+ amount = 5 + (getStat(killedPln, STAT_TOTALXP) / 2);
+ }
+
+ if (killerPln == -1) // m-m-m-m-m-monster kill
+ {
+ terminate;
+ }
+
+ if (isMonster)
+ {
+ amount = (killedHP / 10) * 2;
+ ACS_ExecuteAlways(LEVEL_ADDXP, 0, killerPln, amount, 0);
+ }
+ else
+ {
+ if (killedTeam == killerTeam)
+ {
+ if ((killedTeam == 4) && (killedPln != killerPln))
+ {
+ ACS_ExecuteAlways(LEVEL_ADDXP, 0, killerPln, amount, 0);
+ }
+ }
+ else
+ {
+ ACS_ExecuteAlways(LEVEL_ADDXP, 0, killerPln, amount, 0);
+ }
+ }
+}
+
+
+script GENERAL_ACTIVATE (int which)
+{
+ int pln = PlayerNumber();
+ int i;
+ int cName; int cAmmo; int cAmmoC; int cBit; int weps;
+
+ switch (which)
+ {
+ case 0:
+ int cHP = GetActorProperty(0, APROP_Health);
+ int cMaxHP = GetActorProperty(0, APROP_SpawnHealth);
+ int nMaxHP = getStat(pln, STAT_HP);
+ int dMaxHP = nMaxHP - cMaxHP;
+
+ SetActorProperty(0, APROP_SpawnHealth, nMaxHP);
+ SetActorProperty(0, APROP_Health, cHP + dMaxHP);
+ break;
+
+ case 1:
+ SetActorProperty(0, APROP_SPEED, getStat(pln, STAT_SPEED));
+ break;
+
+ case 2:
+ SetActorProperty(0, APROP_JUMPZ, getStat(pln, STAT_JUMPZ));
+ break;
+
+ case 5: case 6:
+ weps = getStat(pln, STAT_WEPS);
+
+ for (i = 0; i < UNLOCK_WEPCOUNT; i++)
+ {
+ cBit = pow(2, i);
+
+ if (~weps & cBit)
+ {
+ continue;
+ }
+
+ cName = unlockWeapons[i];
+ cAmmo = unlockAmmo[i];
+ cAmmoC = unlockAmmoCount[i];
+
+ //print(d:i, s:" ", s:cName, s:" ", s:cAmmo, s:" ", d:cAmmoC);
+
+ if (!CheckInventory(cName))
+ {
+ GiveInventory(cName, 1);
+
+ if (cAmmo != "<none>")
+ {
+ GiveInventory(cAmmo, cAmmoC);
+ }
+ }
+ }
+ break;
+ }
+}
+
+script GENERAL_UNLOCK (int which, int a1, int a2)
+{
+ int pln = PlayerNumber();
+ int allweps; int choice; int cName; int cAmmo; int cAmmoC; int cBit; int weps;
+ int i;
+
+ switch (which)
+ {
+ case 0:
+ addStat(pln, STAT_HP, a1);
+ break;
+
+ case 1:
+ addStat(pln, STAT_SPEED, a1);
+ break;
+
+ case 2:
+ addStat(pln, STAT_JUMPZ, a1);
+ break;
+
+ case 3:
+ addStat(pln, STAT_AMMO_REGENRATE, a1);
+ break;
+
+ case 4:
+ addStat(pln, STAT_HP_REGENRATE, a1);
+ break;
+
+ case 5:
+ weps = getStat(pln, STAT_WEPS);
+ allweps = pow(2, a2 - a1) - 1;
+ allweps <<= a1;
+
+ if ((weps & allweps) == allweps)
+ {
+ for (i = 0; i < UNLOCK_MAXAMMOCOUNT; i++)
+ {
+ cAmmo = unlockMaxAmmo[i];
+ cAmmoC = unlockMaxAmmoCount[i];
+
+ GiveInventory(cAmmo, cAmmoC);
+ }
+ break;
+ }
+
+ while (1)
+ {
+ choice = random(a1, a2-1);
+ cName = unlockWeapons[choice];
+ cBit = pow(2, choice);
+
+ if (~weps & cBit)
+ {
+ break;
+ }
+ }
+
+ setStat(pln, STAT_WEPS, weps | cBit);
+ break;
+
+ case 6:
+ weps = getStat(pln, STAT_WEPS);
+ setStat(pln, STAT_WEPS, weps | pow(2, a1));
+ break;
+ }
+
+ applyUnlock(pln, which);
+}
+
+script GENERAL_CHECK (int which, int a1, int a2)
+{
+ int pln = PlayerNumber();
+ int quiet; int check; int end;
+
+ switch (which)
+ {
+ case 0:
+ if (a1 < 0)
+ {
+ check = -a1;
+ quiet = 1;
+ }
+ else
+ {
+ check = a1;
+ }
+
+ if (a2 == -1)
+ {
+ a2 = getMax(a1);
+ }
+
+ if (getUnlock(pln, check) < a2)
+ {
+ if (!quiet)
+ {
+ Print(s:"\caNeed to unlock \cd", d:a2, s:"\ca levels of \ck\"", s:getName(a1), s:"\"\ca to unlock this");
+ }
+ end = 0;
+ }
+ else
+ {
+ end = 1;
+ }
+ break;
+ }
+
+ SetResultValue(end);
+}
87 pk3/acs/unlockFuncs.h
@@ -0,0 +1,87 @@
+
+function int abs(int x)
+{
+ if (x < 0) { return -x; }
+ return x;
+}
+
+function int mod(int x, int y)
+{
+ int ret = x - ((x / y) * y);
+
+ if (ret < 0)
+ {
+ ret = y + ret;
+ }
+
+ return ret;
+}
+
+function int pow(int x, int y)
+{
+ int n = 1;
+ while (y-- > 0) { n *= x; }
+
+ return n;
+}
+
+function int min(int x, int y)
+{
+ if (x < y) { return x; }
+ return y;
+}
+
+function int max (int x, int y)
+{
+ if (x > y) { return x; }
+ return y;
+}
+
+function int middle(int x, int y, int z)
+{
+ if ((x < z) && (y < z))
+ {
+ return min(max(x, y), z);
+ }
+
+ return max(min(x, y), z);
+}
+
+function int keyUp(int key)
+{
+ int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
+
+ if (~buttons & key)
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+function int keyDown(int key)
+{
+ int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
+
+ if (buttons & key)
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+function int keyPressed(int key)
+{
+ int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
+ int oldbuttons = GetPlayerInput(-1, INPUT_OLDBUTTONS);
+
+ int newbuttons = (buttons ^ oldbuttons) & buttons;
+
+ if (newbuttons & key)
+ {
+ return 1;
+ }
+
+ return 0;
+}
47 pk3/acs/unlockNames.h
@@ -0,0 +1,47 @@
+#define UNLOCK_BASE 450
+#define UNLOCK_HBASE 21900
+#define UNLOCK_HBASE2 11900
+
+#define UNLOCK_ENTER UNLOCK_BASE-1
+#define UNLOCK_DEATH UNLOCK_BASE-2
+#define UNLOCK_RESPAWN UNLOCK_BASE-3
+#define UNLOCK_DISCONNECT UNLOCK_BASE-4
+#define UNLOCK_REGEN UNLOCK_BASE-5
+
+#define GENERAL_ACTIVATE UNLOCK_BASE+1
+#define GENERAL_UNLOCK UNLOCK_BASE+2
+#define GENERAL_CHECK UNLOCK_BASE+3
+
+#define UNLOCK_MENU UNLOCK_BASE+21
+#define UNLOCK_LEVELHUD UNLOCK_BASE+22
+
+#define LEVEL_ADDXP UNLOCK_BASE+31
+#define LEVEL_RECALC UNLOCK_BASE+32
+#define LEVEL_ADDXP_ONKILL UNLOCK_BASE+39
+
+#define MENU_REFRESH 70
+#define HUD_REFRESH 150
+
+#define MENU_USESPEED 6
+#define MENU_UPSPEED 4
+#define MENU_DOWNSPEED 4
+
+#define AMMO_CLIPRATE 70
+#define AMMO_SHELLRATE 140
+#define AMMO_ROCKETRATE 280
+#define AMMO_CELLRATE 70
+
+#define HEALTH_REGENRATE 70
+
+#define STAT_COUNT 10
+
+#define STAT_HP 0
+#define STAT_SPEED 1
+#define STAT_JUMPZ 2
+#define STAT_XP 3
+#define STAT_TOTALXP 4
+#define STAT_LEVEL 5
+#define STAT_NEXTL 6
+#define STAT_WEPS 7
+#define STAT_AMMO_REGENRATE 8
+#define STAT_HP_REGENRATE 9
79 pk3/acs/unlocks.h
@@ -0,0 +1,79 @@
+//#include "unlockNames.h"
+
+#define UNLOCK_COUNT 7
+#define ENTRY_COUNT 14
+#define UNLOCK_WEPCOUNT 13
+#define UNLOCK_MAXAMMOCOUNT 4
+
+/* Unlockable contents:
+ * activate script, arg 1, arg 2, arg 3,
+ * unlock script, arg 1, arg 2, arg 3,
+ * max, req. script, arg 1, arg 2, arg 3
+ *
+ * If you use GENERAL_UNLOCK as the unlock script,
+ * arg 1 should be the unlock's array index -
+ * otherwise, you get unexpected results (this is a
+ * limitation of ACS scripts only supporting three
+ * arguments)
+ *
+ * -1 as the requirement script = no requirement
+ *
+ * GENERAL_ACTIVATE only uses the first argument
+ */
+
+int unlockables[UNLOCK_COUNT][ENTRY_COUNT] =
+{
+ {GENERAL_ACTIVATE, 0, 0, 0, GENERAL_UNLOCK, 0, 10, 0, -1, -1, 0,0,0},
+ {GENERAL_ACTIVATE, 1, 0, 0, GENERAL_UNLOCK, 1, 0.05, 0, 10, -1, 0,0,0},
+ {GENERAL_ACTIVATE, 2, 0, 0, GENERAL_UNLOCK, 2, 0.5, 0, 10, -1, 0,0,0},
+ {-1, 0, 0, 0, GENERAL_UNLOCK, 3, 1, 0, 10, -1, 0,0,0},
+ {-1, 0, 0, 0, GENERAL_UNLOCK, 4, 1, 0, 10, -1, 0,0,0},
+ {GENERAL_ACTIVATE, 5, 0, 0, GENERAL_UNLOCK, 5, 2,UNLOCK_WEPCOUNT-1,10, GENERAL_CHECK, 0,3,3},
+ {GENERAL_ACTIVATE, 6, 0, 0, GENERAL_UNLOCK, 6, UNLOCK_WEPCOUNT-1,0, 1, GENERAL_CHECK, 0,5,10},
+};
+
+// This is in a seperate array because of ACS bugginess
+int unlockNames[UNLOCK_COUNT] =
+{
+ "Max Health (+10)",
+ "Speed (+5%)",
+ "Jump Height (+0.5)",
+ "Ammo Regen",
+ "Health Regen",
+ "Random New Weapon",
+ "BFG10k",
+};
+
+int unlockWeapons[UNLOCK_WEPCOUNT] =
+{
+ "Fist", "Chainsaw",
+ "Pistol",
+ "Shotgun", "SuperShotgun",
+ "Chaingun", "Minigun",
+ "RocketLauncher", "GrenadeLauncher",
+ "PlasmaRifle", "Railgun",
+ "BFG9000", "BFG10k"
+};
+
+int unlockAmmo[UNLOCK_WEPCOUNT] =
+{
+ "<none>", "<none>",
+ "Clip",
+ "Shell", "Shell",
+ "Clip", "Clip",
+ "RocketAmmo", "RocketAmmo",
+ "Cell", "Cell", "Cell", "Cell",
+};
+
+int unlockAmmoCount[UNLOCK_WEPCOUNT] =
+{
+ 0, 0,
+ 30,
+ 12, 12,
+ 80, 180,
+ 8, 8,
+ 60, 80, 80, 60
+};
+
+int unlockMaxAmmo[UNLOCK_MAXAMMOCOUNT] = {"Clip", "Shell", "RocketAmmo", "Cell"};
+int unlockMaxAmmoCount[UNLOCK_MAXAMMOCOUNT] = {300, 40, 20, 300};
68 pk3/decorate/baseplayer.dec
@@ -0,0 +1,68 @@
+actor UnlockPlayer: DoomPlayer
+{
+ States
+ {
+ Death:
+ PLAY H 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 0,0,0)
+ PLAY H 0 A_PlayerSkinCheck("AltSkinDeath")
+ goto Super::Death
+
+ XDeath:
+ PLAY H 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 0,0,0)
+ PLAY O 0 A_PlayerSkinCheck("AltSkinXDeath")
+ goto Super::XDeath
+ }
+}
+
+actor IsBot: Inventory
+{
+ +UNDROPPABLE
+ Inventory.MaxAmount 1
+}
+
+actor XPGiver: CustomInventory
+{
+ States
+ {
+ Pickup:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP, 0, -1, 1000, 0)
+ stop
+ }
+}
+
+actor SpawnStop: CustomInventory
+{
+ States
+ {
+ Pickup:
+ TNT1 A 0 SetPlayerProperty(0, 1, 0)
+ stop
+ }
+}
+
+actor SpawnProtection: CustomInventory
+{
+ States
+ {
+ Pickup:
+ TNT1 A 0 A_ChangeFlag("SOLID", 0)
+ TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
+ TNT1 A 0 A_ChangeFlag("NOTARGET", 1)
+ TNT1 A 0 A_HideThing
+ stop
+ }
+}
+
+actor EndSpawnProtection: CustomInventory
+{
+ States
+ {
+ Pickup:
+ TNT1 A 0 SetPlayerProperty(0, 0, 0)
+ TNT1 A 0 A_ChangeFlag("SOLID", 1)
+ TNT1 A 0 A_ChangeFlag("SHOOTABLE", 1)
+ TNT1 A 0 A_ChangeFlag("NOTARGET", 1)
+ TNT1 A 0 A_UnhideThing
+ stop
+ }
+}
409 pk3/decorate/monsterreplace.dec
@@ -0,0 +1,409 @@
+actor TacDMZombieman: Zombieman replaces Zombieman
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMShotgunGuy: ShotgunGuy replaces ShotgunGuy
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMChaingunGuy: ChaingunGuy replaces ChaingunGuy
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMSuperShotgunGuy: SuperShotgunGuy replaces SuperShotgunGuy
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMNazi: WolfensteinSS replaces WolfensteinSS
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMCommanderKeen: CommanderKeen replaces CommanderKeen
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMDoomImp: DoomImp replaces DoomImp
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMDarkImp: DarkImp replaces DarkImp
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+
+ XDeath:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::XDeath
+ }
+}
+
+actor TacDMDemon: Demon replaces Demon
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMSpectre: TacDMDemon replaces Spectre
+{
+ RenderStyle Fuzzy
+}
+
+actor TacDMBloodDemon: BloodDemon replaces BloodDemon
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMCacodemon: Cacodemon replaces Cacodemon
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMCacolantern: Cacolantern replaces Cacolantern
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMAbaddon: Abaddon replaces Abaddon
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMLostSoul: LostSoul replaces LostSoul
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMPainElemental: PainElemental replaces PainElemental
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMRevenant: Revenant replaces Revenant
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMFatso: Fatso replaces Fatso
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMHectebus: Hectebus replaces Hectebus
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMArachnotron: Arachnotron replaces Arachnotron
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMHellKnight: HellKnight replaces HellKnight
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMBaronOfHell: BaronOfHell replaces BaronOfHell
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMBelphegor: Belphegor replaces Belphegor
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMArchVile: ArchVile replaces ArchVile
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMCyberdemon: Cyberdemon replaces Cyberdemon
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
+
+actor TacDMSpiderMastermind: SpiderMastermind replaces SpiderMastermind
+{
+ States
+ {
+ Death.Massacre:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ TNT1 A 0 A_NoBlocking
+ stop
+
+ Death:
+ TNT1 A 0 ACS_ExecuteAlways($LEVEL_ADDXP_ONKILL, 0, 1, 0, 0)
+ goto Super::Death
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.