Ammo Providers & Hitscan Compability, Jumping Hitscans, Gun Overheating, MultiRaycast Hitscans. HV Revolvers. - #4335
Ammo Providers & Hitscan Compability, Jumping Hitscans, Gun Overheating, MultiRaycast Hitscans. HV Revolvers.#4335NazrinNya wants to merge 15 commits into
Conversation
|
There was another revolver pr made by fluffen. What happened to that? |
who knows |
|
Revolver PR is currently working except for migrations being dumb or something, I can update it after this one tho |
There was a problem hiding this comment.
why do you empty extend it twice
| @@ -42,6 +47,17 @@ private void OnCartridgeDamageExamine(EntityUid uid, CartridgeAmmoComponent comp | |||
| return p.Damage * Damageable.UniversalProjectileDamageModifier; | |||
| } | |||
| } | |||
| // mono | |||
| else if (entityProto.Components.TryGetValue(Factory.GetComponentName<HitscanBasicDamageComponent>(), out var hitscan)) | |||
| { | |||
| var h = (HitscanBasicDamageComponent) hitscan.Component; | |||
|
|
|||
| if (h.Damage.Empty) | |||
| return null; | |||
|
|
|||
| isHitscan = true; | |||
| return h.Damage; | |||
| } | |||
|
|
|||
| return null; | |||
There was a problem hiding this comment.
actually this should probably use the shared system's methods for bullet protos which i wrote
| gun.ProjectileSpeedModified, | ||
| offset); // Mono - add offset | ||
|
|
||
| if (HasComp<FireControllableComponent>(gunUid)) { |
There was a problem hiding this comment.
why is this not event-based actually
| /// <summary> | ||
| /// Entities that were already hit by hitscan (Or fired it) | ||
| /// </summary> | ||
| public HashSet<int> IgnoredEntities = []; |
There was a problem hiding this comment.
why is this int (and not NetEntity/EntityUid)
why is this not DataField
| [Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
| [Dependency] private readonly SharedTransformSystem _transform = default!; |
|
|
||
| [RegisterComponent] | ||
| public sealed partial class GunOverheatComponent : Component | ||
| { | ||
| [DataField] | ||
| public float FireRatePenalty = 2f; | ||
|
|
||
| [DataField] | ||
| public float SpreadPenalty = 2f; | ||
|
|
||
| [DataField] | ||
| public float HeatCapacity = 100f; | ||
|
|
||
| [DataField] | ||
| public float Heat = 0f; | ||
|
|
||
| [DataField] | ||
| public float HeatPerShot = 5f; | ||
|
|
||
| [DataField] | ||
| public float HeatDissipation = 10f; |
| private float _updateCooldown = 0.25f; | ||
| private float _updateTimer; | ||
|
|
||
| [Dependency] private readonly SharedGunSystem _gun = default!; |
| return; | ||
| } | ||
|
|
||
| var ents = EntityQueryEnumerator<GunOverheatComponent, GunComponent>(); |
There was a problem hiding this comment.
don't need to query for guncomp
|
|
||
| private void OnGunShot(Entity<GunOverheatComponent> ent, ref GunShotEvent ev) | ||
| { | ||
| if (!TryComp<GunComponent>(ent, out var gun)) |
There was a problem hiding this comment.
query since we're trying to optimize guns
|
|
||
| public float CalculatePenalty(float penalty, GunOverheatComponent overheat) | ||
| { | ||
| var i = Math.Pow(overheat.Heat / overheat.HeatCapacity, 0.25f); |
There was a problem hiding this comment.
probably have the exponent be in the comp
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |



About the PR
This PR includes major changes to wizbase.
All ammo providers are now compatible with hitscans.
Added hitscan multiraycast
Added gun overheating, not implemented anywhere currently.
Added hitscans that jump between other mobs (ultrakill coins or some shit)
shit above doesn't matter to normal players so
.45 magnum FMJ -> .45 magnum HV. default .45 magnum now shoots hitscan projectile piercing 1 mob.
Why / Balance
revolvers were underperforming so this should make them somewhat unique now
Media
Requirements
How to test
Breaking changes
Changelog
🆑