summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-05-23 16:15:12 +0200
committerGitHub <noreply@github.com>2020-05-23 16:15:12 +0200
commit530b5ff58d3bd383b9a48555cec9355f70ecaf20 (patch)
treeb76392c3addab639379e02b1ba893a5ebf260170 /src/control
parentskeleton typos (diff)
parentCompatibility with VC weapon.dat + new shotguns (diff)
downloadre3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar.gz
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar.bz2
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar.lz
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar.xz
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.tar.zst
re3-530b5ff58d3bd383b9a48555cec9355f70ecaf20.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Pickups.cpp51
-rw-r--r--src/control/Script.cpp61
-rw-r--r--src/control/Script.h2
3 files changed, 65 insertions, 49 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 4e4c02ab..1d2d06f7 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -46,55 +46,32 @@ tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES];
// TODO(Miami)
uint16 AmmoForWeapon[20] = { 0, 1, 45, 125, 25, 150, 300, 25, 5, 250, 5, 5, 0, 500, 0, 100, 0, 0, 0, 0 };
+
+// --MIAMI: Done
uint16 AmmoForWeapon_OnStreet[WEAPONTYPE_TOTALWEAPONS] = {
- 0,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 4,
- 4,
- 4,
- 4,
- 34,
- 16,
- 100,
- 60,
- 60,
- 60,
- 60,
- 60,
- 20,
- 4,
- 14,
- 1,
- 400,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 34,
+ 12, 16, 14, 10, 100, 60, 60, 60, 60, 60, 20, 14,
+ 4, 150, 100, 500, 1, 400, 36, 0,
};
uint16 CostOfWeapon[20] = { 0, 10, 250, 800, 1500, 3000, 5000, 10000, 25000, 25000, 2000, 2000, 0, 50000, 0, 3000, 0, 0, 0, 0 };
// TODO(Miami): Those are all placeholders!!
uint8 aWeaponReds[] = { 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 0, 128, 255, 255, 0, 255, 0, 128, 128, 255,
-255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 128, 0, 255, 0 };
uint8 aWeaponGreens[] = { 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 255, 128, 255, 0, 255, 128, 255, 0, 255, 255,
-255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 255, 0, 255, 0 };
uint8 aWeaponBlues[] = { 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 0, 255, 0, 255, 255, 0, 128, 255, 0, 255,
-255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 128, 255, 0, 0 };
+
float aWeaponScale[] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
2.0f, 1.5f, 1.0f, 1.0f, 1.5f, 1.0f, 2.0f, 1.0f, 2.0f, 2.5f, 1.0f,
-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f, 1.0f };
void
@@ -722,13 +699,13 @@ CPickups::DoPickUpEffects(CEntity *entity)
int16 colorId;
if (entity->GetModelIndex() == MI_PICKUP_ADRENALINE || entity->GetModelIndex() == MI_PICKUP_CAMERA)
- colorId = WEAPONTYPE_LAST_WEAPONTYPE;
+ colorId = WEAPONTYPE_TOTALWEAPONS;
else if (entity->GetModelIndex() == MI_PICKUP_BODYARMOUR || entity->GetModelIndex() == MI_PICKUP_BRIBE)
- colorId = WEAPONTYPE_LAST_WEAPONTYPE + 1;
+ colorId = WEAPONTYPE_TOTALWEAPONS + 1;
else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY)
- colorId = WEAPONTYPE_LAST_WEAPONTYPE + 2;
+ colorId = WEAPONTYPE_TOTALWEAPONS + 2;
else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS)
- colorId = WEAPONTYPE_LAST_WEAPONTYPE + 3;
+ colorId = WEAPONTYPE_TOTALWEAPONS + 3;
else
colorId = WeaponForModel(entity->GetModelIndex());
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 85098cca..4350d08b 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -6545,7 +6545,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
printf("HAS_CHAR_BEEN_DAMAGED_BY_WEAPON - Character doesn't exist\n");
else {
if (ScriptParams[1] == WEAPONTYPE_ANYMELEE || ScriptParams[1] == WEAPONTYPE_ANYWEAPON)
- result = CheckDamagedWeaponType(ScriptParams[1], pPed->m_lastWepDam);
+ result = CheckDamagedWeaponType(pPed->m_lastWepDam, ScriptParams[1]);
else
result = ScriptParams[1] == pPed->m_lastWepDam;
}
@@ -6561,7 +6561,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
printf("HAS_CAR_BEEN_DAMAGED_BY_WEAPON - Vehicle doesn't exist\n");
else {
if (ScriptParams[1] == WEAPONTYPE_ANYMELEE || ScriptParams[1] == WEAPONTYPE_ANYWEAPON)
- result = CheckDamagedWeaponType(ScriptParams[1], pVehicle->m_nLastWeaponDamage);
+ result = CheckDamagedWeaponType(pVehicle->m_nLastWeaponDamage, ScriptParams[1]);
else
result = ScriptParams[1] == pVehicle->m_nLastWeaponDamage;
}
@@ -11989,12 +11989,23 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
return -1;
}
-bool CRunningScript::CheckDamagedWeaponType(int32 type, int32 actual)
+bool CRunningScript::CheckDamagedWeaponType(int32 actual, int32 type)
{
if (actual == -1)
return false;
+
if (type == WEAPONTYPE_ANYMELEE) {
- switch (actual) {
+ if (actual <= WEAPONTYPE_CHAINSAW)
+ return true;
+ if (actual - WEAPONTYPE_GRENADE <= WEAPONTYPE_MINIGUN)
+ return false;
+ return false;
+ }
+
+ if (type != WEAPONTYPE_ANYWEAPON)
+ return false;
+
+ switch (actual) {
case WEAPONTYPE_UNARMED:
case WEAPONTYPE_BRASSKNUCKLE:
case WEAPONTYPE_SCREWDRIVER:
@@ -12007,16 +12018,44 @@ bool CRunningScript::CheckDamagedWeaponType(int32 type, int32 actual)
case WEAPONTYPE_MACHETE:
case WEAPONTYPE_KATANA:
case WEAPONTYPE_CHAINSAW:
+ case WEAPONTYPE_GRENADE:
+ case WEAPONTYPE_DETONATOR_GRENADE:
+ case WEAPONTYPE_TEARGAS:
+ case WEAPONTYPE_MOLOTOV:
+ case WEAPONTYPE_ROCKET:
+ case WEAPONTYPE_COLT45:
+ case WEAPONTYPE_PYTHON:
+ case WEAPONTYPE_SHOTGUN:
+ case WEAPONTYPE_SPAS12_SHOTGUN:
+ case WEAPONTYPE_STUBBY_SHOTGUN:
+ case WEAPONTYPE_TEC9:
+ case WEAPONTYPE_UZI:
+ case WEAPONTYPE_SILENCED_INGRAM:
+ case WEAPONTYPE_MP5:
+ case WEAPONTYPE_M4:
+ case WEAPONTYPE_RUGER:
+ case WEAPONTYPE_SNIPERRIFLE:
+ case WEAPONTYPE_LASERSCOPE:
+ case WEAPONTYPE_ROCKETLAUNCHER:
+ case WEAPONTYPE_FLAMETHROWER:
+ case WEAPONTYPE_M60:
+ case WEAPONTYPE_MINIGUN:
+ case WEAPONTYPE_DETONATOR:
+ case WEAPONTYPE_HELICANNON:
+ case WEAPONTYPE_CAMERA:
+ case WEAPONTYPE_EXPLOSION:
+ case WEAPONTYPE_UZI_DRIVEBY:
return true;
- default:
+ case WEAPONTYPE_HEALTH:
+ case WEAPONTYPE_ARMOUR:
+ case WEAPONTYPE_RAMMEDBYCAR:
+ case WEAPONTYPE_RUNOVERBYCAR:
+ case WEAPONTYPE_DROWNING:
+ case WEAPONTYPE_FALL:
+ case WEAPONTYPE_UNIDENTIFIED:
return false;
- }
- }
- if (type == WEAPONTYPE_ANYWEAPON) {
- // TODO(MIAMI)!
- return actual != WEAPONTYPE_UNIDENTIFIED && actual != WEAPONTYPE_RAMMEDBYCAR &&
- actual != WEAPONTYPE_RUNOVERBYCAR && actual != WEAPONTYPE_FALL && actual != WEAPONTYPE_DROWNING;
}
+
return false;
}
diff --git a/src/control/Script.h b/src/control/Script.h
index 75a2c1e0..57b997b1 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -516,7 +516,7 @@ private:
}
}
- bool CheckDamagedWeaponType(int32 type, int32 actual);
+ bool CheckDamagedWeaponType(int32 actual, int32 type);
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
};