Skip to content

Commit 99a2538

Browse files
revolucasXottab-DUTY
authored andcommitted
+ Teleport actor to demo cam when you press Enter while in demo_record
~ activate car PPhysicsShell when it spawns so that it collides with ground properly + Added support for a third ammo type static. YOU MUST HAVE <static_third_ammo> in your maingame.xml and maingame_16.xml + added: game_object:get_attached_vehicle() {return game_object} game_object:add_upgrade(section) {void} game_object:has_upgrade(section) {return bool} game_object:iterate_installed_upgrades(lua_function,game_object) game_object:play_hud_motion(anim_section,bMixIn,game_object:get_stat()) {return number} -- animation length game_object:switch_state(number) game_object:get_state() {return number} game_object:activate_hud_item() game_object:deactivate_hud_item() game_object:is_actor_indoors() {return bool} game_object:is_npc_indoors() {return bool} + Added 5 custom slots. IMPORTANT YOU MUST set system.ltx [inventory] properly now. There should be 17 slots!
1 parent 0fe21c1 commit 99a2538

14 files changed

+317
-95
lines changed

src/xrEngine/FDemoRecord.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void CDemoRecord::IR_OnKeyboardPress(int dik)
423423
if (dik == DIK_ESCAPE)
424424
fLifeTime = -1;
425425

426-
#ifndef MASTER_GOLD
426+
#ifdef DEBUG // ndef MASTER_GOLD // Xottab_DUTY: Teleport to demo cam in Debug configuration
427427
if (dik == DIK_RETURN)
428428
{
429429
if (g_pGameLevel->CurrentEntity())
@@ -432,7 +432,7 @@ void CDemoRecord::IR_OnKeyboardPress(int dik)
432432
fLifeTime = -1;
433433
}
434434
}
435-
#endif // #ifndef MASTER_GOLD
435+
#endif
436436

437437
if (dik == DIK_PAUSE)
438438
Device.Pause(!Device.Paused(), TRUE, TRUE, "demo_record");

src/xrGame/Car.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ void CCar::CreateSkeleton(CSE_Abstract* po)
844844
m_pPhysicsShell->SetAirResistance(0.f, 0.f);
845845
m_pPhysicsShell->SetPrefereExactIntegration();
846846
*/
847-
m_pPhysicsShell = P_build_Shell(this, true, &bone_map);
847+
m_pPhysicsShell = P_build_Shell(this, false, &bone_map);
848848
//-Alundaio
849849

850850
ApplySpawnIniToPhysicShell(&po->spawn_ini(), m_pPhysicsShell, false);

src/xrGame/WeaponMagazined.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,34 +1338,30 @@ bool CWeaponMagazined::GetBriefInfo(II_BriefInfo& info)
13381338
GetSuitableAmmoTotal(); // update m_BriefInfo_CalcFrame
13391339
info.grenade = "";
13401340

1341-
u32 at_size = m_ammoTypes.size();
1341+
const u32 at_size = m_ammoTypes.size();
13421342
if (unlimited_ammo() || at_size == 0)
13431343
{
13441344
info.fmj_ammo._set("--");
13451345
info.ap_ammo._set("--");
1346+
info.third_ammo._set("--"); //Alundaio
13461347
}
13471348
else
13481349
{
13491350
// GetSuitableAmmoTotal(); //mp = all type
1351+
//Alundaio: Added third ammo type and cleanup
1352+
info.fmj_ammo._set("");
1353+
info.ap_ammo._set("");
1354+
info.third_ammo._set("");
13501355

1351-
xr_sprintf(int_str, "%d", GetAmmoCount(0)); // !!!!!!!!!!! == 0 temp
1352-
if (m_ammoType == 0)
1353-
info.fmj_ammo = int_str;
1354-
else
1355-
info.ap_ammo = int_str;
1356+
xr_sprintf(int_str, "%d", GetAmmoCount(m_ammoType));
13561357

1357-
if (at_size == 2)
1358-
{
1359-
xr_sprintf(int_str, "%d", GetAmmoCount(1));
1360-
if (m_ammoType == 0)
1361-
info.ap_ammo = int_str;
1362-
else
1363-
info.fmj_ammo = int_str;
1364-
}
1358+
if (m_ammoType == 0)
1359+
info.fmj_ammo._set(int_str);
1360+
else if (m_ammoType == 1)
1361+
info.ap_ammo._set(int_str);
13651362
else
1366-
{
1367-
info.ap_ammo = "";
1368-
}
1363+
info.third_ammo._set(int_str);
1364+
//-Alundaio
13691365
}
13701366

13711367
if (ae != 0 && m_magazine.size() != 0)

src/xrGame/WeaponMagazinedWGrenade.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -926,26 +926,25 @@ bool CWeaponMagazinedWGrenade::GetBriefInfo(II_BriefInfo& info)
926926
{
927927
info.fmj_ammo._set("--");
928928
info.ap_ammo._set("--");
929+
info.third_ammo._set("--"); //Alundaio
929930
}
930931
else
931932
{
932-
u8 ammo_type = m_bGrenadeMode ? m_ammoType2 : m_ammoType;
933-
xr_sprintf(int_str, "%d", m_bGrenadeMode ? GetAmmoCount2(0) : GetAmmoCount(0));
934-
if (ammo_type == 0)
933+
//Alundaio: Added third ammo type and cleanup
934+
info.fmj_ammo._set("");
935+
info.ap_ammo._set("");
936+
info.third_ammo._set("");
937+
938+
const u8 ammo_type = m_bGrenadeMode ? m_ammoType2 : m_ammoType;
939+
xr_sprintf(int_str, "%d", m_bGrenadeMode ? GetAmmoCount2(ammo_type) : GetAmmoCount(ammo_type));
940+
941+
if (m_ammoType == 0)
935942
info.fmj_ammo._set(int_str);
936-
else
943+
else if (m_ammoType == 1)
937944
info.ap_ammo._set(int_str);
938-
939-
if (at_size == 2)
940-
{
941-
xr_sprintf(int_str, "%d", m_bGrenadeMode ? GetAmmoCount2(1) : GetAmmoCount(1));
942-
if (ammo_type == 0)
943-
info.ap_ammo._set(int_str);
944-
else
945-
info.fmj_ammo._set(int_str);
946-
}
947945
else
948-
info.ap_ammo._set("");
946+
info.third_ammo._set(int_str);
947+
//-Alundaio
949948
}
950949

951950
if (ae != 0 && m_magazine.size() != 0)

src/xrGame/inventory_item.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ class CInventoryItem : public CAttachableItem,
279279
bool has_upgrade_group(const shared_str& upgrade_group_id);
280280
void add_upgrade(const shared_str& upgrade_id, bool loading);
281281
bool get_upgrades_str(string2048& res) const;
282+
Upgrades_type get_upgrades() { return m_upgrades; } //Alundaio
282283

283284
bool equal_upgrades(Upgrades_type const& other_upgrades) const;
284285

src/xrGame/script_game_object.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ bool CScriptGameObject::invulnerable() const
563563
return (false);
564564
}
565565

566-
return (monster->invulnerable());
566+
return monster->invulnerable();
567567
}
568568

569569
void CScriptGameObject::invulnerable(bool invulnerable)
@@ -578,22 +578,23 @@ void CScriptGameObject::invulnerable(bool invulnerable)
578578

579579
monster->invulnerable(invulnerable);
580580
}
581-
LPCSTR CScriptGameObject::get_smart_cover_description() const
581+
582+
pcstr CScriptGameObject::get_smart_cover_description() const
582583
{
583584
smart_cover::object* smart_cover_object = smart_cast<smart_cover::object*>(&object());
584585
if (!smart_cover_object)
585586
{
586587
ai().script_engine().script_log(
587588
LuaMessageType::Error, "smart_cover::object : cannot access class member get_smart_cover_description!");
588-
return (0);
589+
return nullptr;
589590
}
590591
return smart_cover_object->cover().description()->table_id().c_str();
591592
}
592593

593594
void CScriptGameObject::set_visual_name(LPCSTR visual) { object().cNameVisual_set(visual); }
594595
LPCSTR CScriptGameObject::get_visual_name() const { return object().cNameVisual().c_str(); }
595596

596-
bool CScriptGameObject::IsActorOutdoors() const
597+
bool CScriptGameObject::IsActorIndoors() const
597598
{
598599
// Check to make sure all the params are available (we're in game and such).
599600
if (!g_pGameLevel)
@@ -606,4 +607,4 @@ bool CScriptGameObject::IsActorOutdoors() const
606607
// Now do the real check! This is a copy out of another section of code that is also hard coded.
607608
// I don't know what the proper limit for this is supposed to be, but this seems good enough.
608609
return e->renderable_ROS()->get_luminocity_hemi() > 0.05f;
609-
}
610+
}

src/xrGame/script_game_object.h

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,29 @@ class CScriptGameObject
402402
int Weapon_Silencer_Status();
403403

404404
//Alundaio
405+
//Weapon
405406
void Weapon_AddonAttach(CScriptGameObject* item);
406407
void Weapon_AddonDetach(pcstr item_section);
407408

409+
//Weapon & Outfit
410+
bool HasUpgrade(pcstr upgrade) const;
411+
void AddUpgrade(pcstr upgrade);
412+
void IterateInstalledUpgrades(luabind::functor<void> functor);
413+
414+
//Car
415+
CScriptGameObject* GetAttachedVehicle();
408416
void AttachVehicle(CScriptGameObject* veh);
409417
void DetachVehicle();
410-
void ForceSetPosition(Fvector3 pos);
418+
419+
//Any class that has PPhysicsShell
420+
void ForceSetPosition(Fvector3 pos, bool bActivate);
421+
422+
//Any class that is derived from CHudItem
423+
u32 PlayHudMotion(pcstr M, bool mixIn, u32 state);
424+
void SwitchState(u32 state);
425+
u32 GetState();
426+
void ActivateHudItem();
427+
void DeactivateHudItem();
411428
//-Alundaio
412429

413430
LPCSTR ProfileName();
@@ -705,7 +722,7 @@ class CScriptGameObject
705722

706723
bool invulnerable() const;
707724
void invulnerable(bool invulnerable);
708-
LPCSTR get_smart_cover_description() const;
725+
pcstr get_smart_cover_description() const;
709726
void set_visual_name(LPCSTR visual);
710727
LPCSTR get_visual_name() const;
711728

@@ -842,7 +859,7 @@ class CScriptGameObject
842859
bool isTorch() const;
843860
bool isWeaponGL() const;
844861
bool isInventoryBox() const;
845-
bool IsActorOutdoors() const;
862+
bool IsActorIndoors() const;
846863
void SetHealthEx(float hp);
847864
//-AVO
848865

0 commit comments

Comments
 (0)