From f0bbfe49989a8d92a69e5642347ae5d504e901b0 Mon Sep 17 00:00:00 2001 From: fugueinheels Date: Thu, 2 Sep 2021 01:43:44 +0100 Subject: [PATCH] aeiou --- PackageScript | 1 + gamedata/sigsegv/custom_attributes.txt | 21 ++++++ gamedata/sigsegv/fugue.txt | 56 ++++++++++++++++ src/gameconf.cpp | 1 + src/mod/attr/custom_attributes.cpp | 90 ++++++++++++++++++++++++-- src/mod/etc/mapentity_additions.cpp | 12 ++++ src/mod/mvm/extended_upgrades.cpp | 52 +++++++++++++-- src/mod/pop/popmgr_extensions.cpp | 61 ++++++++++++++++- src/stub/baseentity.h | 2 +- src/stub/baseplayer.cpp | 3 +- src/stub/baseplayer.h | 5 +- src/stub/entities.cpp | 8 ++- src/stub/entities.h | 11 +++- src/stub/tfplayer.cpp | 2 + src/stub/tfplayer.h | 7 +- 15 files changed, 316 insertions(+), 16 deletions(-) create mode 100644 gamedata/sigsegv/fugue.txt diff --git a/PackageScript b/PackageScript index 7a5a845b..ad8ba692 100644 --- a/PackageScript +++ b/PackageScript @@ -74,6 +74,7 @@ CopyFiles('gamedata/sigsegv', 'addons/sourcemod/gamedata/sigsegv', 'tfbot_locomotion.txt', 'tfbot_vision.txt', 'tfbot_behavior.txt', + 'fugue.txt', ] ) diff --git a/gamedata/sigsegv/custom_attributes.txt b/gamedata/sigsegv/custom_attributes.txt index a606478f..97c16872 100644 --- a/gamedata/sigsegv/custom_attributes.txt +++ b/gamedata/sigsegv/custom_attributes.txt @@ -1909,4 +1909,25 @@ "effect_type" "positive" } + // this doesn't work :rage: + "4505" + { + "name" "custom canteen cond" + "attribute_class" "custom_canteen_cond" + //"attribute_type" "string" + "description_string" "" + "description_format" "value_is_additive" + "hidden" "1" + "effect_type" "positive" + "stored_as_integer" "1" + } + "4506" + { + "name" "can bhop" + "attribute_class" "can_bhop" + "description_string" "Can bunnyhop" + "description_format" "value_is_addtive" + "hidden" "1" + "effect_type" "positive" + } } \ No newline at end of file diff --git a/gamedata/sigsegv/fugue.txt b/gamedata/sigsegv/fugue.txt new file mode 100644 index 00000000..126de28b --- /dev/null +++ b/gamedata/sigsegv/fugue.txt @@ -0,0 +1,56 @@ +"Games" { + "#default" { + "#supported" { + engine "tf2" + } + + "sigsegv" { + "addrs" { + "CTFPlayer::PlayerRunCommand" { + type "sym" + sym "_ZN9CTFPlayer16PlayerRunCommandEP8CUserCmdP11IMoveHelper" + } + "CTFPlayer::Regenerate" { + type "sym" + sym "_ZN9CTFPlayer10RegenerateEb" + } + "CTFGameMovement::PreventBunnyJumping" { + type "sym" + sym "_ZN15CTFGameMovement19PreventBunnyJumpingEv" + } + "CGameMovement::Accelerate" { + type "sym" + sym "_ZN13CGameMovement10AccelerateER6Vectorff" + } + "CGameMovement::AirAccelerate" { + type "sym" + sym "_ZN13CGameMovement13AirAccelerateER6Vectorff" + } + "CBaseCombatCharacter::SetAmmoCount" { + type "sym" + sym "_ZN20CBaseCombatCharacter12SetAmmoCountEii" + } + "CTFPowerupBottle::Use" { + type "sym" + sym "_ZN16CTFPowerupBottle3UseEv" + } + "CTFPowerupBottle::AllowedToUse" { + type "sym" + sym "_ZN16CTFPowerupBottle12AllowedToUseEv" + } + "CTFPowerupBottle::GetNumCharges" { + type "sym" + sym "_ZNK16CTFPowerupBottle13GetNumChargesEv" + } + "CTFPowerupBottle::SetNumCharges" { + type "sym" + sym "_ZN16CTFPowerupBottle13SetNumChargesEh" + } + "CTFGameRules::CanUpgradeWithAttrib" { + type "sym" + sym "_ZN12CTFGameRules20CanUpgradeWithAttribEP9CTFPlayeritP22CMannVsMachineUpgrades" + } + } + } + } +} \ No newline at end of file diff --git a/src/gameconf.cpp b/src/gameconf.cpp index 7c89a2d0..463a5d98 100644 --- a/src/gameconf.cpp +++ b/src/gameconf.cpp @@ -36,6 +36,7 @@ static const char *const configs[] = { "sigsegv/debugoverlay", "sigsegv/client", "sigsegv/convars", + "sigsegv/fugue", nullptr, }; diff --git a/src/mod/attr/custom_attributes.cpp b/src/mod/attr/custom_attributes.cpp index 1ed546f0..b32fef68 100644 --- a/src/mod/attr/custom_attributes.cpp +++ b/src/mod/attr/custom_attributes.cpp @@ -542,6 +542,26 @@ namespace Mod::Attr::Custom_Attributes return ret; } + DETOUR_DECL_MEMBER(void, CTFPlayer_PlayerRunCommand, CUserCmd* cmd, IMoveHelper* moveHelper) + { + CTFPlayer* player = reinterpret_cast(this); + int bunnyhop = 0; + CALL_ATTRIB_HOOK_INT_ON_OTHER(player, bunnyhop, can_bhop); + if(!bunnyhop){ + CTFWeaponBase* weapon = player->GetActiveTFWeapon(); + if(weapon){ + CALL_ATTRIB_HOOK_INT_ON_OTHER(weapon, bunnyhop, can_bhop); + } + } + if(bunnyhop && player->IsAlive() && (cmd->buttons & 2) /*&& (player->GetFlags() & 1) */ && (player->GetGroundEntity() == nullptr)){ + // Vector velocity = player->GetAbsVelocity(); + // velocity.z = 267.0; + // player->SetAbsVelocity(velocity); + cmd->buttons &= ~2; + } + DETOUR_MEMBER_CALL(CTFPlayer_PlayerRunCommand)(cmd, moveHelper); + } + struct CustomModelEntry { CHandle weapon; @@ -1594,15 +1614,26 @@ namespace Mod::Attr::Custom_Attributes bool entityme_player = entityme->IsPlayer(); bool entityhit_player = entityhit->IsPlayer(); - if (!entityme_player || (!entityhit_player && !entityhit->IsBaseObject())) + int not_solid = 0; + CALL_ATTRIB_HOOK_INT_ON_OTHER( entityme, not_solid, not_solid_to_players); + + if (!entityme_player || ((not_solid != 2) && !entityhit_player && !entityhit->IsBaseObject())) return true; + if ((not_solid == 2) && ( + !strcmp(entityhit->GetClassname(), "obj_sentrygun") || + !strcmp(entityhit->GetClassname(), "obj_dispenser") || + !strcmp(entityhit->GetClassname(), "obj_teleporter") + )){ + return true; + } + bool me_collide = true; bool hit_collide = true; auto entry = should_hit_entity_cache.find(entityme); if (entry == should_hit_entity_cache.end()) { - int not_solid = 0; + not_solid = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER( entityme, not_solid, not_solid_to_players); me_collide = not_solid == 0; should_hit_entity_cache[entityme] = me_collide; @@ -1617,7 +1648,7 @@ namespace Mod::Attr::Custom_Attributes if (entityhit_player) { auto entry = should_hit_entity_cache.find(entityhit); if (entry == should_hit_entity_cache.end()) { - int not_solid = 0; + not_solid = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER( entityhit, not_solid, not_solid_to_players); hit_collide = not_solid == 0; should_hit_entity_cache[entityhit] = hit_collide; @@ -3052,11 +3083,62 @@ namespace Mod::Attr::Custom_Attributes OnAttributesChange(mgr); }*/ + THINK_FUNC_DECL(AfterUsedCanteen) + { + reinterpret_cast(this)->m_bActive = false; + } + + DETOUR_DECL_MEMBER(bool, CTFPowerupBottle_Use) + { + bool ret = DETOUR_MEMBER_CALL(CTFPowerupBottle_Use)(); + DevMsg("do"); + if(!ret){ + CTFPowerupBottle* canteen = reinterpret_cast(this); + int cond = 0; + CALL_ATTRIB_HOOK_INT_ON_OTHER(canteen, cond, custom_canteen_cond); + DevMsg("cond: %d", cond); + if((cond != 0) && !canteen->m_bActive && (canteen->GetNumCharges() > 0) && canteen->AllowedToUse()){ + // can't be bothered setting up refunds + float duration = 0; + CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(canteen, duration, powerup_duration); + DevMsg("duration: %f", duration); + CTFPlayer* player = ToTFPlayer(canteen->GetOwnerEntity()); + int extra = 0; + if(!player){ + DevMsg("non null player"); + CALL_ATTRIB_HOOK_INT_ON_OTHER(player, extra, canteen_specialist); + // or stranges + player->m_Shared->AddCond((ETFCond)cond, duration + extra, player); + CWeaponMedigun* medigun = NULL; + CTFPlayer* target = NULL; + if(player->IsPlayerClass(TF_CLASS_MEDIC)){ + medigun = dynamic_cast(player->GetActiveWeapon()); + if(medigun){ + target = ToTFPlayer( medigun->GetHealTarget() ); + if (target){ + target->m_Shared->AddCond((ETFCond)cond, duration + extra, player); + } + } + } + + } + canteen->SetNumCharges(canteen->GetNumCharges() - 1); + canteen->m_bActive = true; + THINK_FUNC_SET(canteen, AfterUsedCanteen, gpGlobals->curtime + duration + extra); + DevMsg("done"); + ret = true; + } + } + return ret; + } + class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener { public: CMod() : IMod("Attr:Custom_Attributes") { + MOD_ADD_DETOUR_MEMBER(CTFPlayer_PlayerRunCommand, "CTFPlayer::PlayerRunCommand"); + MOD_ADD_DETOUR_MEMBER(CTFPowerupBottle_Use, "CTFPowerupBottle::Use"); MOD_ADD_DETOUR_MEMBER(CTFPlayer_CanAirDash, "CTFPlayer::CanAirDash"); MOD_ADD_DETOUR_MEMBER(CWeaponMedigun_AllowedToHealTarget, "CWeaponMedigun::AllowedToHealTarget"); MOD_ADD_DETOUR_MEMBER(CWeaponMedigun_HealTargetThink, "CWeaponMedigun::HealTargetThink"); @@ -3364,4 +3446,4 @@ namespace Mod::Attr::Custom_Attributes [](IConVar *pConVar, const char *pOldValue, float flOldValue){ s_Mod.Toggle(static_cast(pConVar)->GetBool()); }); -} +} \ No newline at end of file diff --git a/src/mod/etc/mapentity_additions.cpp b/src/mod/etc/mapentity_additions.cpp index bb0811ea..fa0668ee 100644 --- a/src/mod/etc/mapentity_additions.cpp +++ b/src/mod/etc/mapentity_additions.cpp @@ -597,6 +597,18 @@ namespace Mod::Etc::Mapentity_Additions } return true; } + else if (stricmp(szInputName, "$RefillAmmo") == 0) { + CTFPlayer* player = ToTFPlayer(ent); + for(int i = 0; i < 7; ++i){ + player->SetAmmoCount(player->GetMaxAmmo(i), i); + } + return true; + } + else if(stricmp(szInputName, "$Regenerate") == 0){ + CTFPlayer* player = ToTFPlayer(ent); + player->Regenerate(true); + return true; + } } else if (ent->GetClassname() == point_viewcontrol_classname) { if (stricmp(szInputName, "$EnableAll") == 0) { diff --git a/src/mod/mvm/extended_upgrades.cpp b/src/mod/mvm/extended_upgrades.cpp index 99b8b2e2..6ca04398 100644 --- a/src/mod/mvm/extended_upgrades.cpp +++ b/src/mod/mvm/extended_upgrades.cpp @@ -3,6 +3,7 @@ #include "stub/tfweaponbase.h" #include "stub/econ.h" #include "stub/gamerules.h" +#include "stub/misc.h" #include "util/iterate.h" #include "util/misc.h" #include "mod/pop/common.h" @@ -11,6 +12,10 @@ #include "stub/strings.h" #include "stub/tf_objective_resource.h" +namespace Mod::Pop::PopMgr_Extensions { + bool ExtendedUpgradesNoUndo(); +} + namespace Mod::MvM::Extended_Upgrades { @@ -128,6 +133,9 @@ namespace Mod::MvM::Extended_Upgrades int allow_wave_max = 9999; std::string required_weapons_string = ""; bool show_requirements = true; + //std::string on_upgrade_output = ""; + std::map on_upgrade_outputs = {}; + bool force_enable = false; }; std::vector upgrades; @@ -214,7 +222,7 @@ namespace Mod::MvM::Extended_Upgrades int upgrade_id = strtol(info, nullptr, 10); if (upgrade_id < 1000) BuyUpgrade(upgrades[upgrade_id], this->slot, this->player, false, false); - else if (upgrade_id == 1000) { + else if ((upgrade_id == 1000) && (!Mod::Pop::PopMgr_Extensions::ExtendedUpgradesNoUndo())) { DevMsg("Undoing %d %d\n", extended_upgrades_start_index, CMannVsMachineUpgradeManager::Upgrades().Count()); for (int i = extended_upgrades_start_index; i < CMannVsMachineUpgradeManager::Upgrades().Count(); i++) { int cur_step; @@ -290,6 +298,12 @@ namespace Mod::MvM::Extended_Upgrades } } + void Parse_OnUpgradeOutputs(KeyValues* kv, std::map& outputs){ + FOR_EACH_SUBKEY(kv, subkey) { + outputs[subkey->GetName()] = subkey->GetFloat(); + } + } + int GetSlotFromString(const char *string) { int slot = -1; if (V_stricmp(string, "Primary") == 0) @@ -424,6 +438,13 @@ namespace Mod::MvM::Extended_Upgrades } } } + else if (FStrEq(subkey2->GetName(), "OnUpgrade")) { + //upgradeinfo->on_upgrade_output = subkey2->GetString(); + Parse_OnUpgradeOutputs(subkey2, upgradeinfo->on_upgrade_outputs); + } + else if (FStrEq(subkey2->GetName(), "ForceEnable")) { + upgradeinfo->force_enable = true; + } } if (upgradeinfo->attributeDefinition == nullptr) { @@ -704,6 +725,27 @@ namespace Mod::MvM::Extended_Upgrades g_hUpgradeEntity->PlayerPurchasingUpgrade(player, override_slot, attr, downgrade, true, false); } from_buy_upgrade_free = false; + //if(upgrade->on_upgrade_output != ""){ + for(const auto& [output, delay] : upgrade->on_upgrade_outputs){ + char param_tokenized[2048] = ""; + V_strncpy(param_tokenized, output.c_str(), sizeof(param_tokenized)); + if(strcmp(param_tokenized, "") != 0){ + char *target = strtok(param_tokenized,","); + char *action = NULL; + char *value = NULL; + if(target != NULL) + action = strtok(NULL,","); + if(action != NULL) + value = strtok(NULL,""); + if(value != NULL){ + CEventQueue &que = g_EventQueue; + variant_t actualvalue; + string_t stringvalue = AllocPooledString(value); + actualvalue.SetString(stringvalue); + que.AddEvent(STRING(AllocPooledString(target)), STRING(AllocPooledString(action)), actualvalue, delay, player, player, -1); + } + } + } } //if (!free) // player->RemoveCurrency(cost); @@ -735,6 +777,7 @@ namespace Mod::MvM::Extended_Upgrades auto upgrade = upgrades[i]; char disabled_reason[255] = ""; bool enabled = IsValidUpgradeForWeapon(upgrade, item, player, disabled_reason, sizeof(disabled_reason)); + if (upgrade->force_enable) enabled = true; if (enabled) { int cur_step; bool over_cap; @@ -777,9 +820,10 @@ namespace Mod::MvM::Extended_Upgrades } } - ItemDrawInfo info1("Undo upgrades"); - menu->AppendItem("1000", info1); - + if(!Mod::Pop::PopMgr_Extensions::ExtendedUpgradesNoUndo()){ + ItemDrawInfo info1("Undo upgrades"); + menu->AppendItem("1000", info1); + } /*if (upgrades.size() == 1) { ItemDrawInfo info1(" ", ITEMDRAW_NOTEXT); menu->AppendItem(" ", info1); diff --git a/src/mod/pop/popmgr_extensions.cpp b/src/mod/pop/popmgr_extensions.cpp index 56bcef4d..cf558301 100644 --- a/src/mod/pop/popmgr_extensions.cpp +++ b/src/mod/pop/popmgr_extensions.cpp @@ -645,7 +645,11 @@ namespace Mod::Pop::PopMgr_Extensions this->m_bHHHNoControlPointLogic = false; this->m_bMinibossSentrySingleKill = false; this->m_bExtendedUpgradesOnly = false; + this->m_bExtendedUpgradesNoUndo = false; this->m_bHHHNonSolidToPlayers = false; + this->m_iBunnyHop = 0; + this->m_iAccelerate = 10; + this->m_iAirAccelerate = 10; this->m_MedievalMode .Reset(); this->m_SpellsEnabled .Reset(); @@ -828,7 +832,11 @@ namespace Mod::Pop::PopMgr_Extensions bool m_bForceRobotBleed; bool m_bMinibossSentrySingleKill; bool m_bExtendedUpgradesOnly; + bool m_bExtendedUpgradesNoUndo; bool m_bHHHNonSolidToPlayers; + int m_iBunnyHop; + int m_iAccelerate; + int m_iAirAccelerate; CPopOverride_MedievalMode m_MedievalMode; CPopOverride_ConVar m_SpellsEnabled; @@ -960,6 +968,10 @@ namespace Mod::Pop::PopMgr_Extensions std::unordered_set m_PlayersByWaveStart; }; PopState state; + + bool ExtendedUpgradesNoUndo(){ // this is very maintainable yes + return Mod::Pop::PopMgr_Extensions::state.m_bExtendedUpgradesNoUndo; + } bool PlayerUsesRobotModel(CTFPlayer *player) { @@ -3456,6 +3468,41 @@ namespace Mod::Pop::PopMgr_Extensions } } + DETOUR_DECL_MEMBER(void, CTFPlayer_PlayerRunCommand, CUserCmd* cmd, IMoveHelper* moveHelper) + { + CTFPlayer* player = reinterpret_cast(this); + if((state.m_iBunnyHop == 1) && player->IsAlive() && (cmd->buttons & 2) /*&& (player->GetFlags() & 1) */ && + (player->GetGroundEntity() == nullptr) && !player->CanAirDash()){ + cmd->buttons &= ~2; + } + DETOUR_MEMBER_CALL(CTFPlayer_PlayerRunCommand)(cmd, moveHelper); + } + + DETOUR_DECL_MEMBER(void, CTFGameMovement_PreventBunnyJumping) + { + if(!state.m_iBunnyHop){ + DETOUR_MEMBER_CALL(CTFGameMovement_PreventBunnyJumping)(); + } + } + + DETOUR_DECL_MEMBER(void, CGameMovement_Accelerate, Vector& direction, float speed, float accel) + { + if(state.m_iAccelerate != -1){ + DETOUR_MEMBER_CALL(CGameMovement_Accelerate)(direction, speed, state.m_iAccelerate); + } else { + DETOUR_MEMBER_CALL(CGameMovement_Accelerate)(direction, speed, accel); + } + } + + DETOUR_DECL_MEMBER(void, CGameMovement_AirAccelerate, Vector& direction, float speed, float accel) + { + if(state.m_iAirAccelerate != -1){ + DETOUR_MEMBER_CALL(CGameMovement_AirAccelerate)(direction, speed, state.m_iAirAccelerate); + } else { + DETOUR_MEMBER_CALL(CGameMovement_AirAccelerate)(direction, speed, accel); + } + } + DETOUR_DECL_MEMBER(bool, CTraceFilterObject_ShouldHitEntity, IHandleEntity *pServerEntity, int contentsMask) { if (state.m_bHHHNonSolidToPlayers) { @@ -4760,12 +4807,20 @@ namespace Mod::Pop::PopMgr_Extensions state.m_bMinibossSentrySingleKill = subkey->GetBool(); } else if (FStrEq(name, "ExtendedUpgradesOnly")) { state.m_bExtendedUpgradesOnly = subkey->GetBool(); + } else if (FStrEq(name, "ExtendedUpgradesNoUndo")) { + state.m_bExtendedUpgradesNoUndo = subkey->GetBool(); } else if (FStrEq(name, "HHHNonSolidToPlayers")) { state.m_bHHHNonSolidToPlayers = subkey->GetBool(); } else if (FStrEq(name, "ItemReplacement")) { Parse_ItemReplacement(subkey); } else if (FStrEq(name, "ExtraLoadoutItems")) { Parse_ExtraLoadoutItems(subkey); + } else if (FStrEq(name, "BunnyHop")) { + state.m_iBunnyHop = subkey->GetInt(); + } else if (FStrEq(name, "Accelerate")) { + state.m_iAccelerate = subkey->GetInt(); + } else if (FStrEq(name, "AirAccelerate")) { + state.m_iAirAccelerate = subkey->GetInt(); // } else if (FStrEq(name, "SprayDecal")) { // Parse_SprayDecal(subkey); } else if (FStrEq(name, "PrecacheScriptSound")) { CBaseEntity::PrecacheScriptSound (subkey->GetString()); @@ -4898,6 +4953,10 @@ namespace Mod::Pop::PopMgr_Extensions public: CMod() : IMod("Pop:PopMgr_Extensions") { + MOD_ADD_DETOUR_MEMBER(CTFPlayer_PlayerRunCommand, "CTFPlayer::PlayerRunCommand"); + MOD_ADD_DETOUR_MEMBER(CTFGameMovement_PreventBunnyJumping, "CTFGameMovement::PreventBunnyJumping"); + MOD_ADD_DETOUR_MEMBER(CGameMovement_Accelerate, "CGameMovement::Accelerate"); + MOD_ADD_DETOUR_MEMBER(CGameMovement_AirAccelerate, "CGameMovement::AirAccelerate"); MOD_ADD_DETOUR_MEMBER(CTFGameRules_PlayerKilled, "CTFGameRules::PlayerKilled"); MOD_ADD_DETOUR_MEMBER(CTFGameRules_ShouldDropSpellPickup, "CTFGameRules::ShouldDropSpellPickup"); MOD_ADD_DETOUR_MEMBER(CTFGameRules_DropSpellPickup, "CTFGameRules::DropSpellPickup"); @@ -5207,4 +5266,4 @@ namespace Mod::Pop::PopMgr_Extensions }; CKVCond_PopMgr cond; -} +} \ No newline at end of file diff --git a/src/stub/baseentity.h b/src/stub/baseentity.h index 2f2c3a3c..a7e81227 100644 --- a/src/stub/baseentity.h +++ b/src/stub/baseentity.h @@ -567,4 +567,4 @@ inline void UTIL_Remove(CBaseEntity *pEntity) } -#endif +#endif \ No newline at end of file diff --git a/src/stub/baseplayer.cpp b/src/stub/baseplayer.cpp index 9cc988ef..7b575638 100644 --- a/src/stub/baseplayer.cpp +++ b/src/stub/baseplayer.cpp @@ -48,6 +48,7 @@ MemberFuncThunk CBaseCombatCharacter::ft_SetBloodColor ("CBaseCombatCharacter::SetBloodColor"); MemberFuncThunk CBaseCombatCharacter::ft_Weapon_Detach ("CBaseCombatCharacter::Weapon_Detach"); MemberFuncThunk CBaseCombatCharacter::ft_SwitchToNextBestWeapon ("CBaseCombatCharacter::SwitchToNextBestWeapon"); +MemberFuncThunk CBaseCombatCharacter::ft_SetAmmoCount ("CBaseCombatCharacter::SetAmmoCount"); MemberVFuncThunk CBaseCombatCharacter::vt_Weapon_GetSlot (TypeName(), "CBaseCombatCharacter::Weapon_GetSlot"); MemberVFuncThunk< CBaseCombatCharacter *, bool, CBaseCombatWeapon *> CBaseCombatCharacter::vt_Weapon_CanSwitchTo (TypeName(), "CBaseCombatCharacter::Weapon_CanSwitchTo"); @@ -106,4 +107,4 @@ MemberVFuncThunk CBasePlayer: MemberVFuncThunk CBasePlayer::vt_EquipWearable (TypeName(),"CBasePlayer::EquipWearable"); -MemberVFuncThunk CBaseMultiplayerPlayer::vt_SpeakConceptIfAllowed(TypeName(), "CTFPlayer::SpeakConceptIfAllowed"); +MemberVFuncThunk CBaseMultiplayerPlayer::vt_SpeakConceptIfAllowed(TypeName(), "CTFPlayer::SpeakConceptIfAllowed"); \ No newline at end of file diff --git a/src/stub/baseplayer.h b/src/stub/baseplayer.h index 98cedea8..2ef29959 100644 --- a/src/stub/baseplayer.h +++ b/src/stub/baseplayer.h @@ -28,7 +28,7 @@ class CBaseCombatCharacter : public CBaseFlex void SetBloodColor(int nBloodColor) { ft_SetBloodColor (this, nBloodColor); } bool Weapon_Detach(CBaseCombatWeapon *pWeapon) { return ft_Weapon_Detach (this, pWeapon); } bool SwitchToNextBestWeapon(CBaseCombatWeapon *weapon) { return ft_SwitchToNextBestWeapon(this, weapon); } - + void SetAmmoCount(int count, int ammoIndex) { ft_SetAmmoCount (this, count, ammoIndex); } CBaseCombatWeapon *Weapon_GetSlot(int slot) const { return vt_Weapon_GetSlot (this, slot); } bool Weapon_CanSwitchTo(CBaseCombatWeapon *pWeapon) { return vt_Weapon_CanSwitchTo (this, pWeapon); } @@ -52,6 +52,7 @@ class CBaseCombatCharacter : public CBaseFlex static MemberFuncThunk ft_SetBloodColor; static MemberFuncThunk ft_Weapon_Detach; static MemberFuncThunk ft_SwitchToNextBestWeapon; + static MemberFuncThunk ft_SetAmmoCount; static MemberVFuncThunk vt_Weapon_GetSlot; static MemberVFuncThunk< CBaseCombatCharacter *, bool, CBaseCombatWeapon *> vt_Weapon_CanSwitchTo; @@ -257,4 +258,4 @@ template int CollectPlayers(CUtlVector *playerVector, int team = TEAM_ANY, bool isAlive = false, bool shouldAppend = false); -#endif +#endif \ No newline at end of file diff --git a/src/stub/entities.cpp b/src/stub/entities.cpp index bc965f83..1d9cb742 100644 --- a/src/stub/entities.cpp +++ b/src/stub/entities.cpp @@ -104,6 +104,12 @@ IMPL_DATAMAP(IPhysicsConstraint *, CItem, m_pConstraint); IMPL_SENDPROP(int, CTFPowerupBottle, m_usNumCharges, CTFPowerupBottle); +IMPL_SENDPROP(int, CTFPowerupBottle, m_bActive, CTFPowerupBottle); + +MemberFuncThunk CTFPowerupBottle::ft_AllowedToUse("CTFPowerupBottle::AllowedToUse"); +MemberFuncThunk CTFPowerupBottle::ft_GetNumCharges("CTFPowerupBottle::GetNumCharges"); +MemberFuncThunk CTFPowerupBottle::ft_SetNumCharges("CTFPowerupBottle::SetNumCharges"); + IMPL_DATAMAP(bool, CTFPowerup, m_bDisabled); IMPL_DATAMAP(bool, CTFPowerup, m_bAutoMaterialize); @@ -253,4 +259,4 @@ IMPL_DATAMAP (CHandle, CTriggerCamera, m_hPlayer); IMPL_DATAMAP (CHandle, CTriggerCamera, m_hTarget); MemberFuncThunk CTriggerCamera::ft_Enable("CTriggerCamera::Enable"); -MemberFuncThunk CTriggerCamera::ft_Disable("CTriggerCamera::Disable"); \ No newline at end of file +MemberFuncThunk CTriggerCamera::ft_Disable("CTriggerCamera::Disable"); diff --git a/src/stub/entities.h b/src/stub/entities.h index c028980d..47cc5683 100644 --- a/src/stub/entities.h +++ b/src/stub/entities.h @@ -148,6 +148,15 @@ class CTFPowerupBottle : public CTFWearable { public: DECL_SENDPROP(int, m_usNumCharges); + DECL_SENDPROP(bool, m_bActive); + bool AllowedToUse(){ return ft_AllowedToUse(this); } + uint8 GetNumCharges(){ return ft_GetNumCharges(this); } + void SetNumCharges(uint8 charges){ ft_SetNumCharges(this, charges); } +private: + static MemberFuncThunk ft_AllowedToUse; + static MemberFuncThunk ft_GetNumCharges; + static MemberFuncThunk ft_SetNumCharges; + }; @@ -507,4 +516,4 @@ class CTriggerCamera : public CBaseEntity // - -#endif +#endif \ No newline at end of file diff --git a/src/stub/tfplayer.cpp b/src/stub/tfplayer.cpp index 183fd8f2..976752f7 100644 --- a/src/stub/tfplayer.cpp +++ b/src/stub/tfplayer.cpp @@ -233,6 +233,8 @@ MemberFuncThunk< CTFPlayer *, void, int > CTFPlayer:: MemberFuncThunk< CTFPlayer *, void > CTFPlayer::ft_CheckInstantLoadoutRespawn ("CTFPlayer::CheckInstantLoadoutRespawn"); MemberFuncThunk< CTFPlayer *, void > CTFPlayer::ft_ForceRegenerateAndRespawn ("CTFPlayer::ForceRegenerateAndRespawn"); MemberFuncThunk< CTFPlayer *, void, Vector & > CTFPlayer::ft_ApplyGenericPushbackImpulse ("CTFPlayer::ApplyGenericPushbackImpulse"); +MemberFuncThunk CTFPlayer::ft_CanAirDash ("CTFPlayer::CanAirDash"); +MemberFuncThunk< CTFPlayer *, void, bool > CTFPlayer::ft_Regenerate ("CTFPlayer::Regenerate"); MemberFuncThunk CTFPlayer::vt_GiveNamedItem("CTFPlayer::GiveNamedItem"); diff --git a/src/stub/tfplayer.h b/src/stub/tfplayer.h index e4d6721e..2d854411 100644 --- a/src/stub/tfplayer.h +++ b/src/stub/tfplayer.h @@ -393,6 +393,8 @@ class CTFPlayer : public CBaseMultiplayerPlayer void CheckInstantLoadoutRespawn() { ft_CheckInstantLoadoutRespawn (this); } void ForceRegenerateAndRespawn() { ft_ForceRegenerateAndRespawn (this); } + bool CanAirDash() const { return ft_CanAirDash (this); } + void Regenerate(bool refillHealthAndAmmo = true) { ft_Regenerate(this, refillHealthAndAmmo); } void ApplyGenericPushbackImpulse(Vector &vec) { ft_ApplyGenericPushbackImpulse (this, vec); } @@ -456,7 +458,10 @@ class CTFPlayer : public CBaseMultiplayerPlayer static MemberFuncThunk< CTFPlayer *, void > ft_CheckInstantLoadoutRespawn; static MemberFuncThunk< CTFPlayer *, void > ft_ForceRegenerateAndRespawn; static MemberFuncThunk< CTFPlayer *, void, Vector & > ft_ApplyGenericPushbackImpulse; + static MemberFuncThunk ft_CanAirDash; + static MemberFuncThunk< CTFPlayer *, void, bool > ft_Regenerate; + static MemberFuncThunk vt_GiveNamedItem; }; @@ -526,4 +531,4 @@ inline void TE_PlayerAnimEvent(CBasePlayer *player, int anim, int data) { ft_TE_ bool GiveItemToPlayer(CTFPlayer *player, CEconEntity *entity, bool no_remove, bool force_give, const char *item_name); -#endif +#endif \ No newline at end of file