v1.1.5
This commit is contained in:
parent
714624d96a
commit
2102f0581f
96 changed files with 1279 additions and 413 deletions
|
|
@ -1,9 +1,12 @@
|
|||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using CS2TraceRay.Class;
|
||||
using CS2TraceRay.Enum;
|
||||
using CS2TraceRay.Struct;
|
||||
using jRandomSkills.src.player;
|
||||
using System.Drawing;
|
||||
using System.Numerics;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
using Vector = CounterStrikeSharp.API.Modules.Utils.Vector;
|
||||
|
|
@ -54,6 +57,21 @@ namespace jRandomSkills
|
|||
filter.m_nHierarchyIds[1] = 0;
|
||||
CGameTrace trace = TraceRay.TraceHull(eyePos, endPos, filter, ray);
|
||||
|
||||
if (Config.LoadedConfig.Settings.CS2TraceRayDebug)
|
||||
{
|
||||
CreateLine(eyePos, endPos, Color.FromArgb(255, 255, 255, 0));
|
||||
CreateLine(new Vector(trace.StartPos.X, trace.StartPos.Y, trace.StartPos.Z), new Vector(trace.EndPos.X, trace.EndPos.Y, trace.EndPos.Z), Color.FromArgb(255, 255, 0, 0));
|
||||
CreateLine(new Vector(trace.StartPos.X, trace.StartPos.Y, trace.StartPos.Z), new Vector(trace.Position.X, trace.Position.Y, trace.Position.Z), Color.FromArgb(255, 0, 0, 255));
|
||||
|
||||
if (trace.DidHit())
|
||||
{
|
||||
var val = Activator.CreateInstance(typeof(CBaseEntity), trace.HitEntity) as CBaseEntity;
|
||||
player.PrintToChat($"Hit: {trace.DidHit()}, Entity: {(val == null ? "null" : val.DesignerName)}, Solid: {trace.AllSolid}, Contents: {(Contents)trace.Contents}");
|
||||
}
|
||||
else
|
||||
player.PrintToChat($"Hit: {trace.DidHit()}, Entity: {trace.HitEntity}, Solid: {trace.AllSolid}, Contents: {(Contents)trace.Contents}");
|
||||
}
|
||||
|
||||
if (!trace.HitPlayer(out CCSPlayerController? target) || target == null)
|
||||
return;
|
||||
|
||||
|
|
@ -66,6 +84,24 @@ namespace jRandomSkills
|
|||
SkillUtils.TryGiveWeapon(player, CsItem.Zeus);
|
||||
}
|
||||
|
||||
private static void CreateLine(Vector start, Vector end, Color color)
|
||||
{
|
||||
CBeam beam = Utilities.CreateEntityByName<CBeam>("beam")!;
|
||||
if (beam == null) return;
|
||||
|
||||
beam.Render = color;
|
||||
beam.Width = 2.0f;
|
||||
beam.EndWidth = 2.0f;
|
||||
beam.Teleport(start);
|
||||
|
||||
beam.EndPos.X = end.X;
|
||||
beam.EndPos.Y = end.Y;
|
||||
beam.EndPos.Z = end.Z;
|
||||
|
||||
beam.DispatchSpawn();
|
||||
beam.AcceptInput("FollowEntity", beam, null!, "");
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#6effc7", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float maxDistance = 4096f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)
|
||||
{
|
||||
public float MaxDistance { get; set; } = maxDistance;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue