-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
262 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
#pragma semicolon 1 | ||
#include <sourcemod> | ||
#include <tf2_stocks> | ||
#include <tf2attributes> | ||
#include <berobot_constants> | ||
#include <berobot> | ||
#include <tf_custom_attributes> | ||
|
||
#define PLUGIN_VERSION "1.0" | ||
#define ROBOT_NAME "Raid" | ||
#define ROBOT_ROLE "Damage" | ||
#define ROBOT_CLASS "Demoman" | ||
#define ROBOT_SUBCLASS "Grenades" | ||
#define ROBOT_DESCRIPTION "Rapid Short Range Iron Bomber" | ||
#define ROBOT_TIPS "Rapid Short Iron Bomber" | ||
#define ROBOT_ON_DEATH "Short Circuit and Airblast are good ways to deal with this robot" | ||
|
||
#define GDEKNIGHT "models/bots/demo_boss/bot_demo_boss.mdl" | ||
#define SPAWN "#mvm/giant_heavy/giant_heavy_entrance.wav" | ||
#define DEATH "mvm/sentrybuster/mvm_sentrybuster_explode.wav" | ||
#define LOOP "mvm/giant_demoman/giant_demoman_loop.wav" | ||
|
||
#define LEFTFOOT ")mvm/giant_demoman/giant_demoman_step_01.wav" | ||
#define LEFTFOOT1 ")mvm/giant_demoman/giant_demoman_step_03.wav" | ||
#define RIGHTFOOT ")mvm/giant_demoman/giant_demoman_step_02.wav" | ||
#define RIGHTFOOT1 ")mvm/giant_demoman/giant_demoman_step_04.wav" | ||
|
||
public Plugin:myinfo = | ||
{ | ||
name = "[TF2] Be the Giant Solar Demoknight", | ||
author = "Erofix using the code from: Pelipoika, PC Gamer, Jaster and StormishJustice", | ||
description = "Play as the Giant Demoknight from MvM", | ||
version = PLUGIN_VERSION, | ||
url = "www.sourcemod.com" | ||
} | ||
|
||
public OnPluginStart() | ||
{ | ||
LoadTranslations("common.phrases"); | ||
|
||
RobotDefinition robot; | ||
robot.name = ROBOT_NAME; | ||
robot.role = ROBOT_ROLE; | ||
robot.class = ROBOT_CLASS; | ||
robot.subclass = ROBOT_SUBCLASS; | ||
robot.shortDescription = ROBOT_DESCRIPTION; | ||
robot.sounds.spawn = SPAWN; | ||
robot.sounds.loop = LOOP; | ||
robot.sounds.death = DEATH; | ||
robot.deathtip = ROBOT_ON_DEATH; | ||
robot.difficulty = ROBOT_DIFFICULTY_HARD; | ||
AddRobot(robot, MakeSolar, PLUGIN_VERSION); | ||
|
||
AddNormalSoundHook(BossMortar); | ||
} | ||
|
||
public Action:BossMortar(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags) | ||
{ | ||
if (!IsValidClient(entity)) return Plugin_Continue; | ||
if (!IsRobot(entity, ROBOT_NAME)) return Plugin_Continue; | ||
|
||
if (strncmp(sample, "player/footsteps/", 17, false) == 0) | ||
{ | ||
if (StrContains(sample, "1.wav", false) != -1) | ||
{ | ||
EmitSoundToAll(LEFTFOOT, entity); | ||
} | ||
else if (StrContains(sample, "3.wav", false) != -1) | ||
{ | ||
EmitSoundToAll(LEFTFOOT1, entity); | ||
} | ||
else if (StrContains(sample, "2.wav", false) != -1) | ||
{ | ||
EmitSoundToAll(RIGHTFOOT, entity); | ||
} | ||
else if (StrContains(sample, "4.wav", false) != -1) | ||
{ | ||
EmitSoundToAll(RIGHTFOOT1, entity); | ||
} | ||
return Plugin_Changed; | ||
} | ||
return Plugin_Continue; | ||
} | ||
|
||
public void OnPluginEnd() | ||
{ | ||
RemoveRobot(ROBOT_NAME); | ||
} | ||
|
||
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) | ||
{ | ||
// CreateNative("BeGiantDemoKnight_MakeSolar", Native_SetGiantDemoKnight); | ||
// CreateNative("BeGiantDemoKnight_IsGiantDemoKnight", Native_IsGiantDemoKnight); | ||
return APLRes_Success; | ||
} | ||
|
||
public OnMapStart() | ||
{ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
public Action:SetModel(client, const String:model[]) | ||
{ | ||
if (IsValidClient(client) && IsPlayerAlive(client)) | ||
{ | ||
SetVariantString(model); | ||
AcceptEntityInput(client, "SetCustomModel"); | ||
|
||
SetEntProp(client, Prop_Send, "m_bUseClassAnimations", 1); | ||
} | ||
} | ||
|
||
MakeSolar(client) | ||
{ | ||
TF2_SetPlayerClass(client, TFClass_DemoMan); | ||
TF2_RegeneratePlayer(client); | ||
|
||
new ragdoll = GetEntPropEnt(client, Prop_Send, "m_hRagdoll"); | ||
if (ragdoll > MaxClients && IsValidEntity(ragdoll)) AcceptEntityInput(ragdoll, "Kill"); | ||
decl String:weaponname[32]; | ||
GetClientWeapon(client, weaponname, sizeof(weaponname)); | ||
if (strcmp(weaponname, "tf_weapon_", false) == 0) | ||
{ | ||
SetEntProp(GetPlayerWeaponSlot(client, 2), Prop_Send, "m_iWeaponState", 0); | ||
TF2_RemoveCondition(client, TFCond_Slowed); | ||
} | ||
CreateTimer(0.0, Timer_Switch, client); | ||
SetModel(client, GDEKNIGHT); | ||
|
||
int iHealth = 4500; | ||
|
||
|
||
int MaxHealth = 175; | ||
float OverHealRate = 1.5; | ||
// PrintToChatAll("MaxHealth %i", MaxHealth); | ||
|
||
int iAdditiveHP = iHealth - MaxHealth; | ||
|
||
TF2_SetHealth(client, iHealth); | ||
// PrintToChatAll("iHealth %i", iHealth); | ||
|
||
// PrintToChatAll("iAdditiveHP %i", iAdditiveHP); | ||
|
||
float OverHeal = float(MaxHealth) * OverHealRate; | ||
float TotalHealthOverHeal = iHealth * OverHealRate; | ||
|
||
float OverHealPenaltyRate = OverHeal / TotalHealthOverHeal; | ||
TF2Attrib_SetByName(client, "patient overheal penalty", OverHealPenaltyRate); | ||
|
||
|
||
SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.75); | ||
SetEntProp(client, Prop_Send, "m_bIsMiniBoss", true); | ||
float HealthPackPickUpRate = float(MaxHealth) / float(iHealth); | ||
TF2Attrib_SetByName(client, "health from packs decreased", HealthPackPickUpRate); | ||
TF2Attrib_SetByName(client, "max health additive bonus", float(iAdditiveHP)); | ||
TF2Attrib_SetByName(client, "damage force reduction", 0.5); | ||
TF2Attrib_SetByName(client, "move speed penalty", 0.5); | ||
TF2Attrib_SetByName(client, "airblast vulnerability multiplier", 0.3); | ||
TF2Attrib_SetByName(client, "cancel falling damage", 1.0); | ||
//TF2Attrib_SetByName(client, "override footstep sound set", 4.0); | ||
TF2Attrib_SetByName(client, "charge impact damage increased", 1.5); | ||
TF2Attrib_SetByName(client, "ammo regen", 100.0); | ||
TF2Attrib_SetByName(client, "rage giving scale", 0.85); | ||
TF2Attrib_SetByName(client, "self dmg push force increased", 2.0); | ||
TF2Attrib_SetByName(client, "head scale", 0.75); | ||
UpdatePlayerHitbox(client, 1.75); | ||
|
||
TF2_RemoveCondition(client, TFCond_CritOnFirstBlood); | ||
TF2_AddCondition(client, TFCond_SpeedBuffAlly, 0.1); | ||
|
||
PrintHintText(client , ROBOT_TIPS); | ||
|
||
} | ||
|
||
stock TF2_SetHealth(client, NewHealth) | ||
{ | ||
SetEntProp(client, Prop_Send, "m_iHealth", NewHealth, 1); | ||
SetEntProp(client, Prop_Data, "m_iHealth", NewHealth, 1); | ||
SetEntProp(client, Prop_Data, "m_iMaxHealth", NewHealth, 1); | ||
} | ||
|
||
public Action:Timer_Switch(Handle:timer, any:client) | ||
{ | ||
if (IsValidClient(client)) | ||
GiveGiantDemoKnight(client); | ||
} | ||
|
||
#define BroadBandBonnet 31307 | ||
#define StovePipe 100 | ||
|
||
stock GiveGiantDemoKnight(client) | ||
{ | ||
if (IsValidClient(client)) | ||
{ | ||
RoboRemoveAllWearables(client); | ||
|
||
TF2_RemoveWeaponSlot(client, 0); | ||
TF2_RemoveWeaponSlot(client, 1); | ||
TF2_RemoveWeaponSlot(client, 2); | ||
|
||
CreateRoboWeapon(client, "tf_weapon_grenadelauncher", 1151, 6, 1, 2, 0); | ||
|
||
|
||
|
||
CreateRoboHat(client, BroadBandBonnet, 10, 6, 0.0, 1.0, -1.0); | ||
CreateRoboHat(client, StovePipe, 10, 6, 0.0, 1.0, -1.0); | ||
|
||
|
||
|
||
|
||
int Weapon1 = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary); | ||
if(IsValidEntity(Weapon1)) | ||
{ | ||
// TF2Attrib_RemoveAll(Weapon1); | ||
// TF2Attrib_SetByName(Weapon1, "damage penalty", 0.8); | ||
TF2Attrib_SetByName(Weapon1, "fire rate bonus", 0.20); | ||
TF2Attrib_SetByName(Weapon1, "clip size bonus", 2.25); | ||
TF2Attrib_SetByName(Weapon1, "killstreak tier", 1.0); | ||
TF2Attrib_SetByName(Weapon1, "faster reload rate", 1.75); | ||
TF2Attrib_SetByName(Weapon1, "projectile speed decreased", 0.8); | ||
|
||
TF2Attrib_SetByName(Weapon1, "hidden primary max ammo bonus", 3.0); | ||
|
||
<<<<<<< HEAD | ||
TF2Attrib_SetByName(Weapon1, "dmg penalty vs buildings", 0.15); | ||
======= | ||
TF2Attrib_SetByName(Weapon1, "dmg penalty vs buildings", 0.5); | ||
>>>>>>> robot-tweaks | ||
TF2CustAttr_SetString(Weapon1, "reload full clip at once", "1.0"); | ||
|
||
|
||
} | ||
} | ||
} | ||
|
||
public void TF2_OnConditionAdded(int client, TFCond condition) | ||
{ | ||
|
||
//PrintToChatAll("CONDITION WAS: %i for %N", condition, client); | ||
if (IsRobot(client, ROBOT_NAME) && condition == TFCond_Charging) | ||
{ | ||
SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", 550.0); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters