Add shareware support and spawn correctly for difficulty levels

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-14 17:01:01 +01:00
parent 690ac1e7e6
commit 278c73a256
19 changed files with 383 additions and 238 deletions

View File

@@ -132,7 +132,7 @@ class Player {
switch (item.type) {
case CollectibleType.health:
if (health >= 100) return false;
heal(item.mapId == MapObjectId.dogFood ? 4 : 25);
heal(item.mapId == MapObject.dogFoodDecoration ? 4 : 25);
pickedUp = true;
break;
@@ -147,11 +147,11 @@ class Player {
break;
case CollectibleType.treasure:
if (item.mapId == MapObjectId.cross) score += 100;
if (item.mapId == MapObjectId.chalice) score += 500;
if (item.mapId == MapObjectId.chest) score += 1000;
if (item.mapId == MapObjectId.crown) score += 5000;
if (item.mapId == MapObjectId.extraLife) {
if (item.mapId == MapObject.cross) score += 100;
if (item.mapId == MapObject.chalice) score += 500;
if (item.mapId == MapObject.chest) score += 1000;
if (item.mapId == MapObject.crown) score += 5000;
if (item.mapId == MapObject.extraLife) {
heal(100);
addAmmo(25);
}
@@ -159,7 +159,7 @@ class Player {
break;
case CollectibleType.weapon:
if (item.mapId == MapObjectId.machineGun) {
if (item.mapId == MapObject.machineGun) {
if (weapons[WeaponType.machineGun] == null) {
weapons[WeaponType.machineGun] = MachineGun();
hasMachineGun = true;
@@ -168,7 +168,7 @@ class Player {
requestWeaponSwitch(WeaponType.machineGun);
pickedUp = true;
}
if (item.mapId == MapObjectId.chainGun) {
if (item.mapId == MapObject.chainGun) {
if (weapons[WeaponType.chainGun] == null) {
weapons[WeaponType.chainGun] = ChainGun();
hasChainGun = true;
@@ -180,8 +180,8 @@ class Player {
break;
case CollectibleType.key:
if (item.mapId == MapObjectId.goldKey) hasGoldKey = true;
if (item.mapId == MapObjectId.silverKey) hasSilverKey = true;
if (item.mapId == MapObject.goldKey) hasGoldKey = true;
if (item.mapId == MapObject.silverKey) hasSilverKey = true;
pickedUp = true;
break;
}