AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   VSH / Freak Fortress (https://forums.alliedmods.net/forumdisplay.php?f=154)
-   -   [BOTH] Streaker (Increase killstreak count) (https://forums.alliedmods.net/showthread.php?t=263264)

93SHADoW 05-22-2015 00:03

[BOTH] Streaker (Increase killstreak count)
 
10 Attachment(s)
Pretty much self-explanatory.

When a player has at least 1 killstreak-enabled weapon equipped, for every X or greater amount of damage dealt to the boss, it will increase the player's current killstreak by a specified amount (provided they are not a boss or a boss's companion/minion), regardless whether the active weapon is a killstreak weapon or not.

Works with both VSH and FF2.

In-game Screenshot:
http://i.imgur.com/x6NViAPl.jpg

Dependencies:
  • Requires SM 1.7.x or later

Convars:
  • streaker_version: Plugin version (Current version: 1.0)
  • streaker_updater: Updater support? 1=Enable, 0=Disable (default: 0)
  • streaker_kstreak_dmg: MINIMUM damage to increase killstreak count (default: 200)
  • streaker_kstreak: Amount of killstreaks given (default: 1)

OPTIONAL:
  • updater.inc if you want to compile with updater support

Chdata 05-22-2015 09:43

Re: [BOTH] Streaker (Increase killstreak count)
 
Make an option to only update killstreaks whenever one passes intervals of 5 kills.

Powerlord 05-22-2015 10:27

Re: [BOTH] Streaker (Increase killstreak count)
 
You'll probably want this block to do detection for VSH/FF2 on startup:

PHP Code:

public void OnAllPluginsLoaded()
{
    
#if defined _updater_included
    
if (LibraryExists("updater") && GetConVarBool(cvarUpdater))
    {
        
Updater_AddPlugin(UPDATE_URL);
    }
    
#endif
    
    #if defined _VSH_included
    
if (LibraryExists("saxtonhale"))
    {
        
isVSH=true;
    }
    
#endif
    
    #if defined _FF2_included
    
if (LibraryExists("freak_fortress_2"))
    {
        
isFF2=true;
    }
    
#endif


Edit: Although now that I think about it, that's not going to work for the updater check as this would be called before cvars are set from config files... might have to add in a new bool and do this check the first time OnConfigsExecuted is called.

Quote:

Originally Posted by Chdata (Post 2299674)
Make an option to only update killstreaks whenever one passes intervals of 5 kills.

You're aware that this plugin only works for non-bosses, right?

sarysa 05-22-2015 13:13

Re: [BOTH] Streaker (Increase killstreak count)
 
Nice. Have you figured out a workaround for the spy problem? Since actual spy damage in OnTakeDamagePost() is inaccurate, at least with FF2.

Chdata 05-23-2015 05:09

Re: [BOTH] Streaker (Increase killstreak count)
 
Quote:

Originally Posted by Powerlord (Post 2299695)
You're aware that this plugin only works for non-bosses, right?

Yes. What does that have to do with anything? It converts damage to kills.

I just realized though, this plugin probably doesn't create event_player_death to show the actual killstreak notifications in the upper right / middle of the screen (for every 5 kills).

Quote:

Originally Posted by sarysa (Post 2299770)
Nice. Have you figured out a workaround for the spy problem? Since actual spy damage in OnTakeDamagePost() is inaccurate, at least with FF2.

You should always be able to grab whatever damage a spy actual deals either by player_hurt or.. . ....... ... place whatever code you need that amount for right after you actually calculate the spy's damage formula.

PHP Code:

            if (iDmgCustom == TF_CUSTOM_BACKSTAB)
            {
                    new 
Float:flHaleHealthMax float(HaleHealthMax);
                    
flDamage = ( BackstabCalculate(flHaleHealthMax) )/3.0;
                    
iDmgType |= DMG_CRIT|DMG_PREVENT_PHYSICS_FORCE;
                    
                    
SpyBackstabCallback(iVictimiAtkerflDamage*3.0); // Since this is OnTakeDamage (pre) the crit gets applied later.
            




All times are GMT -4. The time now is 12:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.