Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
109ab1d93a | ||
|
|
a3aa798186 | ||
|
|
ab88a1edd7 | ||
|
|
125296a37e | ||
|
|
a8941335f9 | ||
|
|
552078bb29 | ||
|
|
33be9bf439 | ||
|
|
f0ebe74408 | ||
|
|
1b56e6a24c | ||
|
|
c455618913 | ||
|
|
d28c654ee5 | ||
|
|
9b3250e499 | ||
|
|
2fddd8e732 | ||
|
|
edc4b8fecd |
@@ -0,0 +1,40 @@
|
|||||||
|
WeaponData
|
||||||
|
{
|
||||||
|
MP_BASE
|
||||||
|
{
|
||||||
|
"ammo_clip_size" "200"
|
||||||
|
"ammo_default_total" "200"
|
||||||
|
"ammo_display" "bar"
|
||||||
|
"ammo_min_to_fire" "100"
|
||||||
|
"ammo_per_shot" "100"
|
||||||
|
"ammo_stockpile_max" "200"
|
||||||
|
"fire_rate" "2"
|
||||||
|
"regen_ammo_refill_rate" "16"
|
||||||
|
|
||||||
|
"enable_highlight_networking_on_creation" "<KEEP_DEFAULT>"
|
||||||
|
}
|
||||||
|
"regen_ammo_refill_start_delay" "2.0"
|
||||||
|
Mods
|
||||||
|
{
|
||||||
|
pas_power_cell
|
||||||
|
{
|
||||||
|
"regen_ammo_refill_rate" "*1.35"
|
||||||
|
}
|
||||||
|
|
||||||
|
dev_mod_low_recharge
|
||||||
|
{
|
||||||
|
"regen_ammo_refill_rate" "*10"
|
||||||
|
}
|
||||||
|
amped_tacticals
|
||||||
|
{
|
||||||
|
"ammo_clip_size" "300"
|
||||||
|
"ammo_default_total" "300"
|
||||||
|
"ammo_stockpile_max" "300"
|
||||||
|
"regen_ammo_refill_rate" "*1.5"
|
||||||
|
}
|
||||||
|
mode_holoshift
|
||||||
|
{
|
||||||
|
"hud_icon" "rui/menu/boosts/boost_icon_holopilot"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Name": "Legonzaur.HoloShift",
|
"Name": "Legonzaur.HoloShift",
|
||||||
"Description": "Swap positions with your beloved decoy",
|
"Description": "Swap positions with your beloved decoy. Compatible with HoloTracker.",
|
||||||
"Version": "0.3",
|
"Version": "1.0.10",
|
||||||
"LoadPriority": 2,
|
"LoadPriority": 2,
|
||||||
"Scripts": [
|
"Scripts": [
|
||||||
{
|
{
|
||||||
@@ -9,7 +9,14 @@
|
|||||||
"RunOn": "MP",
|
"RunOn": "MP",
|
||||||
"ServerCallback": {
|
"ServerCallback": {
|
||||||
"After": "HoloShift_Init"
|
"After": "HoloShift_Init"
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"Path": "HolopilotIconChange.nut",
|
||||||
|
"RunOn": "MP",
|
||||||
|
"ServerCallback": {
|
||||||
|
"After": "HolopilotIconChangeInit"
|
||||||
|
},
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
untyped
|
||||||
|
global function HolopilotIconChangeInit
|
||||||
|
|
||||||
|
|
||||||
|
void function HolopilotIconChangeInit()
|
||||||
|
{
|
||||||
|
#if SERVER
|
||||||
|
AddCallback_OnPlayerRespawned( HolopilotIconChange )
|
||||||
|
//AddCallback_PlayerClassChanged( HolopilotIconChange )
|
||||||
|
//AddCallback_OnPlayerLifeStateChanged( HolopilotIconChange )
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if SERVER
|
||||||
|
|
||||||
|
void function HolopilotIconChange(entity player){
|
||||||
|
//void function HolopilotIconChange(entity player, int oldState, int newState){
|
||||||
|
Assert( IsAlive( player ) )
|
||||||
|
if(player.GetOffhandWeapons().len() > 1 && player.GetOffhandWeapons()[1].GetWeaponClassName() == "mp_ability_holopilot"){
|
||||||
|
array <string> offhandMods = player.GetOffhandWeapons()[1].GetMods()
|
||||||
|
offhandMods.append("mode_holoshift")
|
||||||
|
player.GetOffhandWeapons()[1].SetMods(offhandMods)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -7,55 +7,40 @@ void function HoloShift_Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int rechargeStep = 1 //defines speed at which counter is added or removed
|
|
||||||
float rechargeInterval = 1/20
|
|
||||||
int charge_size = 100
|
int charge_size = 100
|
||||||
int charge_max = 200
|
|
||||||
int recharge_remove = 1
|
bool IsLaunched = false
|
||||||
|
|
||||||
#if SERVER
|
#if SERVER
|
||||||
void function HoloRecharge(){
|
void function HoloRecharge(){
|
||||||
thread HoloRecharge_Threaded()
|
if(!IsLaunched) {
|
||||||
|
thread HoloRecharge_Threaded()
|
||||||
|
IsLaunched = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void function HoloRecharge_Threaded(){
|
void function HoloRecharge_Threaded(){
|
||||||
|
float rechargeMultiplier = charge_size/DECOY_DURATION
|
||||||
while(true){
|
while(true){
|
||||||
array<entity> players = GetPlayerArray()
|
array<entity> players = GetPlayerArray()
|
||||||
foreach (entity player in players)
|
foreach (entity player in players)
|
||||||
{
|
{
|
||||||
if ( IsValid(player) && IsAlive( player ))
|
if ( IsValid(player) && IsAlive( player ))
|
||||||
{
|
{
|
||||||
if(player.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot"){
|
if( IsValid(player.GetOffhandWeapon(1)) && player.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot"){
|
||||||
Assert(player)
|
Assert(player)
|
||||||
if(!player.IsPhaseShifted()){
|
if(!player.IsPhaseShifted()){
|
||||||
int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()
|
if(player in playerDecoyActiveFrom){
|
||||||
int oldchargeCount = chargeCount
|
float chargeCount = float(player.GetOffhandWeapon(1).GetWeaponPrimaryClipCountMax()) - ((Time() - playerDecoyActiveFrom[player])*rechargeMultiplier)
|
||||||
if(player in playerDecoyList){
|
chargeCount = max(chargeCount, 0.0) // can be negative in weird cases
|
||||||
chargeCount -= recharge_remove
|
player.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(int(chargeCount))
|
||||||
if(chargeCount < 0)
|
|
||||||
chargeCount = 0
|
|
||||||
}else{
|
|
||||||
int max = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCountMax()
|
|
||||||
chargeCount += rechargeStep
|
|
||||||
if(chargeCount > charge_size){
|
|
||||||
chargeCount = max
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(oldchargeCount != chargeCount){
|
|
||||||
player.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(chargeCount)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wait rechargeInterval
|
wait 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -30,7 +30,7 @@ struct
|
|||||||
file
|
file
|
||||||
|
|
||||||
global table< entity > playerDecoyList //CUSTOM used to track the decoy the user will be teleported to
|
global table< entity > playerDecoyList //CUSTOM used to track the decoy the user will be teleported to
|
||||||
|
global table< entity, float > playerDecoyActiveFrom //CUSTOM used to set decoy ability discharge
|
||||||
|
|
||||||
|
|
||||||
#if SERVER
|
#if SERVER
|
||||||
@@ -46,6 +46,10 @@ void function CleanupExistingDecoy( entity decoy )
|
|||||||
{
|
{
|
||||||
if ( IsValid( decoy ) ) //This cleanup function is called from multiple places, so check that decoy is still valid before we try to clean it up again
|
if ( IsValid( decoy ) ) //This cleanup function is called from multiple places, so check that decoy is still valid before we try to clean it up again
|
||||||
{
|
{
|
||||||
|
//COMMUNICATION WITH HOLOTRACKER
|
||||||
|
int eHandle = decoy.GetEncodedEHandle()
|
||||||
|
ServerToClientStringCommand( decoy.GetBossPlayer(), "StopDecoyTracking " + eHandle.tostring())
|
||||||
|
//END OF COMMUNICATION
|
||||||
decoy.Decoy_Dissolve()
|
decoy.Decoy_Dissolve()
|
||||||
CleanupFXAndSoundsForDecoy( decoy )
|
CleanupFXAndSoundsForDecoy( decoy )
|
||||||
}
|
}
|
||||||
@@ -86,6 +90,10 @@ void function OnHoloPilotDestroyed( entity decoy )
|
|||||||
if(bossPlayer in playerDecoyList){
|
if(bossPlayer in playerDecoyList){
|
||||||
if(decoy == playerDecoyList[bossPlayer])
|
if(decoy == playerDecoyList[bossPlayer])
|
||||||
delete playerDecoyList[bossPlayer]
|
delete playerDecoyList[bossPlayer]
|
||||||
|
|
||||||
|
}
|
||||||
|
if(bossPlayer in playerDecoyActiveFrom){
|
||||||
|
delete playerDecoyActiveFrom[bossPlayer]
|
||||||
}
|
}
|
||||||
EmitSoundOnEntityOnlyToPlayer( bossPlayer, bossPlayer, "holopilot_end_1P" )
|
EmitSoundOnEntityOnlyToPlayer( bossPlayer, bossPlayer, "holopilot_end_1P" )
|
||||||
}
|
}
|
||||||
@@ -135,6 +143,9 @@ var function OnWeaponPrimaryAttack_holopilot( entity weapon, WeaponPrimaryAttack
|
|||||||
weaponOwner.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(0)
|
weaponOwner.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(0)
|
||||||
}
|
}
|
||||||
PlayerUsesHoloRewind(weaponOwner, decoy)
|
PlayerUsesHoloRewind(weaponOwner, decoy)
|
||||||
|
if(weaponOwner in playerDecoyActiveFrom){
|
||||||
|
delete playerDecoyActiveFrom[weaponOwner]
|
||||||
|
}
|
||||||
if(GetCurrentPlaylistName() == "lts"){
|
if(GetCurrentPlaylistName() == "lts"){
|
||||||
if(PlayerHasBattery(weaponOwner)){
|
if(PlayerHasBattery(weaponOwner)){
|
||||||
Rodeo_TakeBatteryAwayFromPilot(weaponOwner)
|
Rodeo_TakeBatteryAwayFromPilot(weaponOwner)
|
||||||
@@ -151,6 +162,11 @@ var function OnWeaponPrimaryAttack_holopilot( entity weapon, WeaponPrimaryAttack
|
|||||||
}else{
|
}else{
|
||||||
entity decoy = CreateHoloPilotDecoys( weaponOwner, 1 )
|
entity decoy = CreateHoloPilotDecoys( weaponOwner, 1 )
|
||||||
playerDecoyList[ weaponOwner ] <- decoy
|
playerDecoyList[ weaponOwner ] <- decoy
|
||||||
|
|
||||||
|
//COMMUNICATION WITH HOLOTRACKER
|
||||||
|
int eHandle = decoy.GetEncodedEHandle()
|
||||||
|
ServerToClientStringCommand( weaponOwner, "ActivateDecoyTracking " + eHandle.tostring())
|
||||||
|
//END OF COMMUNICATION
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Rumble_Play( "rumble_holopilot_activate", {} )
|
Rumble_Play( "rumble_holopilot_activate", {} )
|
||||||
@@ -185,7 +201,7 @@ entity function CreateHoloPilotDecoys( entity player, int numberOfDecoysToMake =
|
|||||||
decoy.EnableAttackableByAI( 50, 0, AI_AP_FLAG_NONE )
|
decoy.EnableAttackableByAI( 50, 0, AI_AP_FLAG_NONE )
|
||||||
SetObjectCanBeMeleed( decoy, true )
|
SetObjectCanBeMeleed( decoy, true )
|
||||||
decoy.SetTimeout( DECOY_DURATION )
|
decoy.SetTimeout( DECOY_DURATION )
|
||||||
|
playerDecoyActiveFrom[player] <- Time()
|
||||||
if ( setOriginAndAngles )
|
if ( setOriginAndAngles )
|
||||||
{
|
{
|
||||||
vector angleToAdd = CalculateAngleSegmentForDecoy( i, HOLOPILOT_ANGLE_SEGMENT )
|
vector angleToAdd = CalculateAngleSegmentForDecoy( i, HOLOPILOT_ANGLE_SEGMENT )
|
||||||
@@ -421,18 +437,36 @@ void function PlayerUsesHoloRewindThreaded( entity player, entity decoy )
|
|||||||
entity mover = CreateScriptMover( player.GetOrigin(), player.GetAngles() )
|
entity mover = CreateScriptMover( player.GetOrigin(), player.GetAngles() )
|
||||||
player.SetParent( mover, "REF" )
|
player.SetParent( mover, "REF" )
|
||||||
|
|
||||||
OnThreadEnd( function() : ( player, mover, decoy )
|
table decoyData = {}
|
||||||
|
decoyData.forceCrouch <- TraceLine
|
||||||
|
( decoy.GetOrigin(),
|
||||||
|
decoy.GetOrigin() + < 0,0,80 >, // 40 is crouched pilot height! add additional 40 for better check
|
||||||
|
[ decoy ],
|
||||||
|
TRACE_MASK_SHOT,
|
||||||
|
TRACE_COLLISION_GROUP_NONE
|
||||||
|
).hitEnt != null // decoy will stuck, need to forceCrouch player
|
||||||
|
|
||||||
|
OnThreadEnd( function() : ( player, mover, decoy, decoyData )
|
||||||
{
|
{
|
||||||
player.SetOrigin(decoy.GetOrigin())
|
if ( IsValid( player ) )
|
||||||
player.SetAngles(decoy.GetAngles())
|
{
|
||||||
player.SetVelocity(decoy.GetVelocity())
|
player.SetOrigin(decoy.GetOrigin())
|
||||||
CancelPhaseShift( player )
|
player.SetAngles(decoy.GetAngles())
|
||||||
player.DeployWeapon()
|
player.SetVelocity(decoy.GetVelocity())
|
||||||
player.SetPredictionEnabled( true )
|
CancelPhaseShift( player )
|
||||||
player.ClearParent()
|
player.DeployWeapon()
|
||||||
ViewConeFree( player )
|
player.SetPredictionEnabled( true )
|
||||||
mover.Destroy()
|
player.ClearParent()
|
||||||
CleanupExistingDecoy(decoy)
|
ViewConeFree( player )
|
||||||
|
if( decoyData.forceCrouch )
|
||||||
|
thread HoloRewindForceCrouch( player ) // this will handle "UnforceCrouch()"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( IsValid( mover ) )
|
||||||
|
mover.Destroy()
|
||||||
|
|
||||||
|
if ( IsValid( decoy ) )
|
||||||
|
CleanupExistingDecoy(decoy)
|
||||||
})
|
})
|
||||||
|
|
||||||
vector initial_origin = player.GetOrigin()
|
vector initial_origin = player.GetOrigin()
|
||||||
@@ -442,6 +476,8 @@ void function PlayerUsesHoloRewindThreaded( entity player, entity decoy )
|
|||||||
ViewConeZero( player )
|
ViewConeZero( player )
|
||||||
player.HolsterWeapon()
|
player.HolsterWeapon()
|
||||||
player.SetPredictionEnabled( false )
|
player.SetPredictionEnabled( false )
|
||||||
|
if( decoyData.forceCrouch )
|
||||||
|
player.ForceCrouch() // avoid stucking!
|
||||||
PhaseShift( player, 0.0, 7 * PHASE_REWIND_PATH_SNAPSHOT_INTERVAL * 1.5 )
|
PhaseShift( player, 0.0, 7 * PHASE_REWIND_PATH_SNAPSHOT_INTERVAL * 1.5 )
|
||||||
|
|
||||||
for ( float i = 7; i > 0; i-- )
|
for ( float i = 7; i > 0; i-- )
|
||||||
@@ -457,4 +493,13 @@ void function PlayerUsesHoloRewindThreaded( entity player, entity decoy )
|
|||||||
mover.NonPhysicsRotateTo( decoy.GetAngles(), PHASE_REWIND_PATH_SNAPSHOT_INTERVAL, 0, 0 )
|
mover.NonPhysicsRotateTo( decoy.GetAngles(), PHASE_REWIND_PATH_SNAPSHOT_INTERVAL, 0, 0 )
|
||||||
player.SetVelocity( decoy.GetVelocity() )
|
player.SetVelocity( decoy.GetVelocity() )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void function HoloRewindForceCrouch( entity player )
|
||||||
|
{
|
||||||
|
// make player crouch
|
||||||
|
player.ForceCrouch()
|
||||||
|
wait 0.2 // magic number, player must be completely crouched to avoid auto-stand
|
||||||
|
if( IsValid( player ) )
|
||||||
|
player.UnforceCrouch()
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user