Improved ability recharge
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Name": "Legonzaur.HoloShift",
|
"Name": "Legonzaur.HoloShift",
|
||||||
"Description": "Swap positions with your beloved decoy",
|
"Description": "Swap positions with your beloved decoy",
|
||||||
"Version": "1.0.4",
|
"Version": "1.0.6",
|
||||||
"LoadPriority": 2,
|
"LoadPriority": 2,
|
||||||
"Scripts": [
|
"Scripts": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,18 +7,21 @@ 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(){
|
||||||
|
if(!IsLaunched) {
|
||||||
thread HoloRecharge_Threaded()
|
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)
|
||||||
@@ -28,34 +31,16 @@ int recharge_remove = 1
|
|||||||
if( IsValid(player.GetOffhandWeapon(1)) && 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
|
print("test")
|
||||||
if(player in playerDecoyList){
|
float chargeCount = float(player.GetOffhandWeapon(1).GetWeaponPrimaryClipCountMax()) - ((Time() - playerDecoyActiveFrom[player])*rechargeMultiplier)
|
||||||
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
|
||||||
@@ -86,6 +86,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 +139,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)
|
||||||
@@ -185,7 +192,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 )
|
||||||
|
|||||||
Reference in New Issue
Block a user