RTD icon indicating copy to clipboard operation
RTD copied to clipboard

Restore Demo Shield Roll

Open fearts opened this issue 6 years ago • 2 comments

Feature request roll. In Freak Fortress and Saxton Hale you can lose your shield if the hale hits you and it blocks some damage. A roll just for Demos that restores your shield would be cool.

fearts avatar Sep 28 '18 03:09 fearts

This should be done via the Freak Fortress plugin. However, the RTD plugin doesn't support custom functions for checking if a perk is applicable for client, such as has they lost their shield.

I may look into supporting such functions, or having more advanced parsing system of the weapon classes in config, so you can include a sort of blacklist for each perk.

For now, what the FF plugin could do, is to use some existing perk to restore the shield. For example, check if Infinite Ammo is being applied and resupply the shield with it.

Phil25 avatar Sep 28 '18 04:09 Phil25

Some examples from my version of FF2.

public void SetShield_Call(int client, Perk perk, bool apply){
	if(!apply) return;

	if(FF2_GetClientShield(client)<=0) return;

	FF2_SetClientShield(client, _, perk.GetPrefCell("health"), perk.GetPrefCell("resistance"));
}

public void TimedShield_Call(int client, Perk perk, bool apply){
	if(apply) TimedShield_ApplyPerk(client);
	else TimedShield_RemovePerk(client);
}

public void TimedShield_ApplyPerk(int client){
	if(FF2_GetClientShield(client)<=0) return;

	FF2_SetClientShield(client, _, perk.GetPrefCell("health"), perk.GetPrefCell("resistance"));
}

public void TimedShield_RemovePerk(int client){
	if(FF2_GetClientShield(client)<=0) return;

	FF2_SetClientShield(client, _, 100);
}

public void BreakShield_Call(int client, Perk perk, bool apply){
	if(!apply) return;

	if(FF2_GetClientShield(client)<=0) return;

	FF2_RemoveClientShield(client);
}

Batfoxkid avatar May 03 '19 19:05 Batfoxkid