diff -uwr source/scripts/SoldierGameObj.h sourceold/scripts/SoldierGameObj.h --- source/scripts/SoldierGameObj.h 2015-05-31 07:05:27.725609300 +1000 +++ sourceold/scripts/SoldierGameObj.h 2015-05-30 06:50:00.250976500 +1000 @@ -191,8 +191,7 @@ bool Block_Action_Key() { return BlockActionKey; } void Set_Freeze(bool onoff) {Freeze = onoff; Set_Object_Dirty_Bit(BIT_RARE, true);} bool Is_Frozen() {return Freeze;} - void Lock_Collision_Mode(bool lockCollisionGroup,Collision_Group_Type lock); - Collision_Group_Type *Get_Locked_Collision_Mode(); + void Lock_Ghost_Collision_Mode(bool lock); protected: RenderObjClass * WeaponRenderModel; //2416 RenderObjClass * BackWeaponRenderModel; //2420 diff -uwr source/scripts/dllmain.cpp sourceold/scripts/dllmain.cpp --- source/scripts/dllmain.cpp 2015-05-31 07:05:27.725609300 +1000 +++ sourceold/scripts/dllmain.cpp 2015-05-30 06:50:00.250976500 +1000 @@ -351,8 +351,7 @@ Grant_Weapon = (grw)Address(tt,"Grant_Weapon"); Set_Object_Visibility_For_Player = (sovfp)Address(tt,"Set_Object_Visibility_For_Player"); Set_Object_Visibility = (sov)Address(tt,"Set_Object_Visibility"); - Lock_Soldier_Collision_Group = (lscg)Address(tt,"Lock_Soldier_Collision_Group"); - Unlock_Soldier_Collision_Group = (ulscg)Address(tt,"Unlock_Soldier_Collision_Group"); + Lock_Soldier_Ghost_Collision_Group = (lsgcg)Address(tt,"Lock_Soldier_Ghost_Collision_Group"); #ifdef SSGM SSGMGameManager::Init(); #endif diff -uwr source/scripts/dp88_misc.cpp sourceold/scripts/dp88_misc.cpp --- source/scripts/dp88_misc.cpp 2015-05-31 21:43:40.656273400 +1000 +++ sourceold/scripts/dp88_misc.cpp 2015-05-04 21:36:32.269531200 +1000 @@ -2775,96 +2775,3 @@ "DriverEnterCustom=0:int," "DriverExitCustom=0:int" ); - -/*------------------------ -Custom Points Percentage script ---------------------------*/ - -void dp88_customPointsPercentage::Created ( GameObject* obj ) -{ - // Preload values since converting strings to floats every time we take - // damage is very inefficient - m_killPoints = Get_Float_Parameter("killPoints") / 100; - m_damagePoints = Get_Float_Parameter("damagePoints") / 100; - m_repairPoints = Get_Float_Parameter("repairPoints") / 100; - m_killMoney = Get_Float_Parameter("killMoney") / 100; - m_damageMoney = Get_Float_Parameter("damageMoney") / 100; - m_repairMoney = Get_Float_Parameter("repairMoney") / 100; -} - -// ------------------------------------------------------------------------------------------------- - -void dp88_customPointsPercentage::Damaged ( GameObject *obj, GameObject *damager, float amount ) -{ - // Abort if there is no damager, or the unit damaged itself, or the damager is not - // a star - if ( !damager || damager == obj || !Commands->Is_A_Star(damager) ) - return; - - /* Damaged or repaired? Then convert amount into it's absolute value for - calculating points granted */ - bool bRepair = (amount < 0); - float points = ((bRepair) ? m_repairPoints : m_damagePoints) * amount; - float money = ((bRepair) ? m_repairMoney : m_damageMoney) * amount; - - // Give the damager their points and money - GivePointsAndMoney ( damager, points, money ); -} - -// ------------------------------------------------------------------------------------------------- - -void dp88_customPointsPercentage::Killed ( GameObject* obj, GameObject *killer ) -{ - // Abort if there is no killer, or the unit killed itself, or the killer is not - // a star - if ( !killer || killer == obj || !Commands->Is_A_Star(killer) ) - return; - - // Give the killer their points and money - GivePointsAndMoney ( killer, m_killPoints, m_killMoney ); -} - -// ------------------------------------------------------------------------------------------------- - -void dp88_customPointsPercentage::GivePointsAndMoney ( GameObject* obj, float points, float money ) -{ - float pointsMultiplier = 1.f; - SmartGameObj *smart = obj->As_SmartGameObj(); - if (smart->Is_Teammate(Owner()->As_DamageableGameObj())) - { - pointsMultiplier = -pointsMultiplier; - } - else if (!smart->Is_Enemy(Owner()->As_DamageableGameObj())) - { - pointsMultiplier = 0.f; - } - points *= pointsMultiplier; - money *= pointsMultiplier; - int playerId = Get_Player_ID(obj); - if ( playerId >= 0 ) - { - if ( cPlayer* player = Find_Player(playerId) ) - { - player->Set_Score(player->Get_Score()+points); - if (money > 0) - { - player->Increment_Money(money); - } - } - } - - int team = Get_Object_Type(obj); - Set_Team_Score(team, Get_Team_Score(team) + points); -} - -// ------------------------------------------------------------------------------------------------- - -ScriptRegistrant dp88_customPointsPercentage_Registrant( - "dp88_customPointsPercentage", - "killPoints:float," - "damagePoints:float," - "repairPoints:float," - "killMoney:float," - "damageMoney:float," - "repairMoney:float" -); diff -uwr source/scripts/dp88_misc.h sourceold/scripts/dp88_misc.h --- source/scripts/dp88_misc.h 2015-05-31 21:43:30.122093700 +1000 +++ sourceold/scripts/dp88_misc.h 2015-05-04 21:36:32.285156200 +1000 @@ -426,23 +426,6 @@ /*! @} */ }; -class dp88_customPointsPercentage : public ScriptImpClass -{ -protected: - void Created(GameObject* obj); - void Damaged(GameObject *obj, GameObject *damager, float amount); - void Killed(GameObject* obj, GameObject *killer); - - void GivePointsAndMoney(GameObject* obj, float points, float money); - - float m_killPoints; - float m_damagePoints; - float m_repairPoints; - float m_killMoney; - float m_damageMoney; - float m_repairMoney; -}; - // ------------------------------------------------------------------------------------------------- /*! diff -uwr source/scripts/engine_phys.cpp sourceold/scripts/engine_phys.cpp --- source/scripts/engine_phys.cpp 2015-05-31 07:07:22.584984300 +1000 +++ sourceold/scripts/engine_phys.cpp 2015-05-16 23:09:35.704101500 +1000 @@ -163,7 +163,7 @@ if ((Get_Object_Type(obj) == team) || (team == 2)) { bool stealth = Is_Stealth(obj); - bool underground = obj->As_VehicleGameObj() && obj->As_VehicleGameObj()->Is_Underground(); + bool underground = obj->As_VehicleGameObj()->Is_Underground(); if (stealth || underground) { ObjPosition = Commands->Get_Position(obj); diff -uwr source/scripts/engine_tt.cpp sourceold/scripts/engine_tt.cpp --- source/scripts/engine_tt.cpp 2015-05-31 07:05:27.725609300 +1000 +++ sourceold/scripts/engine_tt.cpp 2015-05-30 06:50:00.250976500 +1000 @@ -202,8 +202,7 @@ SCRIPTS_API grw Grant_Weapon; SCRIPTS_API sovfp Set_Object_Visibility_For_Player; SCRIPTS_API sov Set_Object_Visibility; -SCRIPTS_API lscg Lock_Soldier_Collision_Group; -SCRIPTS_API ulscg Unlock_Soldier_Collision_Group; +SCRIPTS_API lsgcg Lock_Soldier_Ghost_Collision_Group; SCRIPTS_API bool Can_Team_Build_Vehicle(int Team) { diff -uwr source/scripts/engine_tt.h sourceold/scripts/engine_tt.h --- source/scripts/engine_tt.h 2015-05-31 07:05:27.741234300 +1000 +++ sourceold/scripts/engine_tt.h 2015-05-30 06:50:00.266601500 +1000 @@ -158,8 +158,7 @@ typedef void (*grw) (GameObject *object,const char *GrantWeaponName,bool GrantWeapon, int GrantWeaponRounds, bool GrantWeaponClips); typedef void (*sovfp) (GameObject *player,int objectId,bool visible); typedef void (*sov) (int objectId,bool visible); -typedef void (*lscg) (GameObject *obj,Collision_Group_Type collisionGroupType); -typedef void (*ulscg) (GameObject *obj); +typedef void (*lsgcg) (GameObject *obj,bool lock); SCRIPTS_API extern gpl Get_Player_List; SCRIPTS_API extern gcmi Get_Current_Map_Index; SCRIPTS_API extern gm Get_Map; @@ -320,8 +319,7 @@ SCRIPTS_API extern grw Grant_Weapon; SCRIPTS_API extern sovfp Set_Object_Visibility_For_Player; SCRIPTS_API extern sov Set_Object_Visibility; -SCRIPTS_API extern lscg Lock_Soldier_Collision_Group; -SCRIPTS_API extern ulscg Unlock_Soldier_Collision_Group; +SCRIPTS_API extern lsgcg Lock_Soldier_Ghost_Collision_Group; class SCRIPTS_API JFW_Key_Hook_Base : public ScriptImpClass { public: diff -uwr source/scripts/jfwobj.cpp sourceold/scripts/jfwobj.cpp --- source/scripts/jfwobj.cpp 2015-06-09 08:36:06.653320300 +1000 +++ sourceold/scripts/jfwobj.cpp 2015-05-27 09:18:23.230468700 +1000 @@ -3794,20 +3794,6 @@ { InstallHook(Get_Parameter("Keyhook"),sender); pilotID = Commands->Get_ID(sender); - if (switching || veterancylevel != Get_Int_Parameter("VeteranLevel")) - { - return; - } - if (secondweap) - { - Commands->Select_Weapon(obj, Get_Parameter("Weapon2")); - Commands->Set_Model(obj, Get_Parameter("Model2")); - } - else - { - Commands->Select_Weapon(obj, Get_Parameter("Weapon1")); - Commands->Set_Model(obj, Get_Parameter("Model1")); - } } } if (type == CUSTOM_EVENT_VEHICLE_EXITED) @@ -3821,20 +3807,6 @@ if (type == CUSTOM_VETERANCY_PROMOTED) { veterancylevel = param; - if (switching || veterancylevel != Get_Int_Parameter("VeteranLevel")) - { - return; - } - if (secondweap) - { - Commands->Select_Weapon(obj, Get_Parameter("Weapon2")); - Commands->Set_Model(obj, Get_Parameter("Model2")); - } - else - { - Commands->Select_Weapon(obj, Get_Parameter("Weapon1")); - Commands->Set_Model(obj, Get_Parameter("Model1")); - } } } void Killed(GameObject *obj,GameObject *killer) @@ -3852,7 +3824,7 @@ } else { - Commands->Select_Weapon(obj,Get_Parameter("Weapon1")); + Commands->Select_Weapon(obj,Get_Parameter("Weapon2")); Commands->Set_Model(obj,Get_Parameter("Model1")); } } @@ -3878,32 +3850,7 @@ Commands->Start_Timer(obj,this,Get_Float_Parameter("SwitchTime"),1); } }; -REGISTER_SCRIPT(JFW_Veteran_Weapon_Switch,"Weapon1:string,Weapon2:string,Keyhook:string,Model1:string,Model2:string,VeteranLevel:int,Sound1:string,Sound2:string,SwitchTime:float"); -class JFW_Object_Spawn : public ScriptImpClass { -public: - int id; - void Created(GameObject *obj) - { - id = 0; - GameObject *o = Commands->Create_Object(Get_Parameter("Object"),Commands->Get_Position(obj)); - if (o) - { - id = Commands->Get_ID(o); - } - } - void Destroyed(GameObject *obj) - { - if (id) - { - GameObject *o = Commands->Find_Object(id); - if (o) - { - Commands->Destroy_Object(o); - } - } - } -}; -REGISTER_SCRIPT(JFW_Object_Spawn,"Object:string"); +REGISTER_SCRIPT(JFW_Veteran_Weapon_Switch,"Weappn1:string,Weapon2:string,Keyhook:string,Model1:string,Model2:string,VeteranLevel:int,Sound1:string,Sound2:string,SwitchTime:float"); ScriptRegistrant JFW_Add_Objective_Registrant("JFW_Add_Objective","Type:int,TypeVal:int,Objective_Num:int,Objective_Type:int,Title_ID:int,Unknown:int,Sound_Name:string,Description_ID:int,Timer_Custom:int,Trigger:int"); ScriptRegistrant JFW_Remove_Objective_Registrant("JFW_Remove_Objective","Type:int,TypeVal:int,Objective_Num:int,Timer_Custom:int"); ScriptRegistrant JFW_Set_Objective_Status_Registrant("JFW_Set_Objective_Status","Type:int,TypeVal:int,Objective_Num:int,Status:int,Timer_Custom:int"); diff -uwr source/scripts/jmgBearHunter.cpp sourceold/scripts/jmgBearHunter.cpp --- source/scripts/jmgBearHunter.cpp 2015-05-31 11:22:00.900414000 +1000 +++ sourceold/scripts/jmgBearHunter.cpp 2015-05-30 06:50:00.266601500 +1000 @@ -3389,7 +3389,7 @@ PlayerData.getPlayerNode(obj); if (!PlayerData.players[playerId]->destroyTime || difftime(clock(),PlayerData.players[playerId]->destroyTime) > 500) Set_Background_Music_Player(obj,JMG_Bear_Hunter_Game_Control::currentSong); - Lock_Soldier_Collision_Group(obj,SOLDIER_GHOST_COLLISION_GROUP); + Lock_Soldier_Ghost_Collision_Group(obj,true); if (Get_Player_Type(obj) != 0 && Get_Player_Type(obj) != 1) return; @@ -5639,7 +5639,7 @@ GameObject *DefGun = Commands->Find_Object(PlayerData.players[Get_Int_Parameter("PlayerID")]->sentryTurretId); if (DefGun) { - float refund = 500.0f*Commands->Get_Health(DefGun)/Commands->Get_Max_Health(DefGun); + float refund = 1000.0f*Commands->Get_Health(DefGun)/Commands->Get_Max_Health(DefGun); char refundMsg[220]; sprintf(refundMsg,"You have been refudned $%s because you can only have one placed sentry gun at a time",JmgUtility::formatDigitGrouping(refund)); JmgUtility::DisplayChatMessage(Player,127,127,255,refundMsg); diff -uwr source/scripts/jmgUtility.cpp sourceold/scripts/jmgUtility.cpp --- source/scripts/jmgUtility.cpp 2015-05-31 11:29:49.797875000 +1000 +++ sourceold/scripts/jmgUtility.cpp 2015-05-27 09:38:06.283203100 +1000 @@ -718,5 +718,5 @@ ScriptRegistrant JMG_Utility_Sync_Object_Periodically_Registrant("JMG_Utility_Sync_Object_Periodically","Sync_Rate=1.0:float"); ScriptRegistrant JMG_Utility_Basic_Spawner_Registrant("JMG_Utility_Basic_Spawner","SpawnPreset:string,RespawnTime=0.0:float,RespawnTimeRandom=0:float,StartsEnabled=1:int,EnableMessage=0:int,SpawnLimit=-1:int,DelayOnStartup=0:int"); ScriptRegistrant JMG_Utility_Basic_Spawner_Attach_Registrant("JMG_Utility_Basic_Spawner_Attach","ControllerId:int"); -ScriptRegistrant JMG_Utility_Engineer_AI_Registrant("JMG_Utility_Engineer_AI","RepaiarGun_Preset=Weapon_RepairGun_Player:string,Weapon_Preset=Weapon_Pistol_Player:string,PatrolRange=50.0:float,BaseCenterPoint=0.0 0.0 0.0:vector3"); +ScriptRegistrant JMG_Utility_Engineer_AI_Registrant("JMG_Utility_Engineer_AI","RepaiarGun_Preset=Weapon_RepairGun_Player:string,Weapon_Preset=Weapon_Pistol_Player:string,BaseCenterPoint=0.0 0.0 0.0:vector3,PatrolRange=0.0:float"); ScriptRegistrant JMG_Utility_Set_Object_Visibility_For_Player_On_Custom_Registrant("JMG_Utility_Set_Object_Visibility_For_Player_On_Custom","Message:int,PlayerID:int,Visible:int");