v1.1.0
This commit is contained in:
parent
6b8988ade4
commit
26cb787b57
125 changed files with 9157 additions and 1940 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
||||
|
|
@ -7,25 +8,24 @@ namespace jRandomSkills
|
|||
{
|
||||
public class RobinHood : ISkill
|
||||
{
|
||||
private static Skills skillName = Skills.RobinHood;
|
||||
private const Skills skillName = Skills.RobinHood;
|
||||
private static int moneyMultiplier = Config.GetValue<int>(skillName, "moneyMultiplier");
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
if (Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Active != true)
|
||||
return;
|
||||
|
||||
SkillUtils.RegisterSkill(skillName, "#119125");
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
|
||||
Instance.RegisterEventHandler<EventPlayerHurt>((@event, info) =>
|
||||
{
|
||||
var victim = @event.Userid;
|
||||
var attacker = @event.Attacker;
|
||||
var damage = @event.DmgHealth;
|
||||
if (!Instance.IsPlayerValid(victim) || !Instance.IsPlayerValid(attacker)) return HookResult.Continue;
|
||||
if (!Instance.IsPlayerValid(attacker) || !Instance.IsPlayerValid(victim) || attacker == victim) return HookResult.Continue;
|
||||
|
||||
var attackerInfo = Instance.skillPlayer.FirstOrDefault(p => p.SteamID == attacker.SteamID);
|
||||
if (attackerInfo?.Skill != skillName) return HookResult.Continue;
|
||||
|
||||
int moneyToSteal = damage * 35;
|
||||
int moneyToSteal = damage * moneyMultiplier;
|
||||
StealMoney(victim, attacker, moneyToSteal);
|
||||
|
||||
return HookResult.Continue;
|
||||
|
|
@ -45,5 +45,14 @@ namespace jRandomSkills
|
|||
attackerMoneyServices.Account = Math.Min(attackerMoneyServices.Account + moneyToAdd, 16000);
|
||||
Utilities.SetStateChanged(attacker, "CCSPlayerController", "m_pInGameMoneyServices");
|
||||
}
|
||||
|
||||
public class SkillConfig : Config.DefaultSkillInfo
|
||||
{
|
||||
public int MoneyMultiplier { get; set; }
|
||||
public SkillConfig(Skills skill = skillName, bool active = true, string color = "#119125", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, int moneyMultiplier = 35) : base(skill, active, color, onlyTeam, needsTeammates)
|
||||
{
|
||||
MoneyMultiplier = moneyMultiplier;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue