-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Lightning-Factor #543
Closed
Closed
The Lightning-Factor #543
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
8960987
it works
WarMechanic e5c2f55
add initial weightings
WarMechanic 4270666
tesla coils absorb lightning charge, reconsolidate lightning charge v…
WarMechanic aa37867
remove electrified component from lightning
WarMechanic cd93f05
allow parsing functions into lightning parameters
WarMechanic 2064a49
add LightningContext constructor
WarMechanic a3e2b4c
fixes various Invalid Weight errors
WarMechanic 51006c6
consolidations
WarMechanic adfe78b
reimplement lightning shock
WarMechanic f52115b
lightning damage scales with charge
WarMechanic 907a689
fix lightning stacking
WarMechanic 06a0132
another weighted pick fix
WarMechanic 6df2db8
fix tesla being shaded
WarMechanic 722cb4b
cull exploding behaviour from LightningTarget, use Explosive instead
WarMechanic 89218fd
reimplement lightning resistance
WarMechanic fb470db
name consolidation + stacking options
WarMechanic 37da556
fix LightningTarget not being able to influence LightningContext
WarMechanic ac5c8fe
adjusts prototypes, electrical devices are explosive again
WarMechanic f8d23b3
change system to use damage specifiers
WarMechanic c902785
oops
WarMechanic 6cda0e0
increase odds of hitting mobs
WarMechanic af55fa7
uncrash
WarMechanic 4e56c75
stopgap stuff
WarMechanic a9b7126
improves electrocution damage logic
WarMechanic de543cb
allow machines to take electrocution damage
WarMechanic 40b32d4
stop giving a damage popup when 0 electrocute damage is dealt
WarMechanic b6b4b72
coils/rods no longer take shock damage, weighting buffs
WarMechanic 02db056
consolidation
WarMechanic 228590a
allow wall lights to be targeted by lightning
WarMechanic 3584d28
update LightningArcShooter to use math
WarMechanic 3eb4a4f
Merge branch 'master' into lightning
WarMechanic 07fcfe3
migrate types to shared
WarMechanic 71162d7
Merge branch 'master' of https://github.com/WarMechanic/Einstein-Engi…
WarMechanic 301f951
fix LightningArcShooter fork chance being inverted
WarMechanic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -403,7 +403,11 @@ private void RollMalfunction(Entity<ActiveMicrowaveComponent, MicrowaveComponent | |||||||||||||
} | ||||||||||||||
|
||||||||||||||
if (_random.Prob(ent.Comp2.LightningChance)) | ||||||||||||||
_lightning.ShootRandomLightnings(ent, 1.0f, 2, MalfunctionSpark, triggerLightningEvents: false); | ||||||||||||||
_lightning.ShootRandomLightnings(ent, 1.0f, 2, 5000f, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
lightningPrototype: MalfunctionSpark, | ||||||||||||||
electrocute: false, | ||||||||||||||
explode: false | ||||||||||||||
); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
/// <summary> | ||||||||||||||
|
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,60 +13,31 @@ namespace Content.Server.Lightning.Components; | |||||||||
public sealed partial class LightningTargetComponent : Component | ||||||||||
{ | ||||||||||
/// <summary> | ||||||||||
/// The probability that this target will not be ignored by a lightning strike. This is necessary for Tesla's balance. | ||||||||||
/// The probability weighting of being stuck by lightning, compared against other nearby lightning targets. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public float HitProbability = 1f; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// Priority level for selecting a lightning target. | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public int Priority; | ||||||||||
[DataField] | ||||||||||
public float Weighting = 1f; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// Lightning has a number of bounces into neighboring targets. | ||||||||||
/// This number controls how many bounces the lightning bolt has left after hitting that target. | ||||||||||
/// At high values, the lightning will not travel farther than that entity. | ||||||||||
/// For the love of god, do not make this number negative. | ||||||||||
/// </summary> | ||||||||||
Comment on lines
+25
to
26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public int LightningResistance = 1; //by default, reduces the number of bounces from this target by 1 | ||||||||||
|
||||||||||
// BOOM PART | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// Will the entity explode after being struck by lightning? | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public bool LightningExplode = true; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// The explosion prototype to spawn | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public ProtoId<ExplosionPrototype> ExplosionPrototype = "Default"; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// The total amount of intensity an explosion can achieve | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public float TotalIntensity = 25f; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// How quickly does the explosion's power slope? Higher = smaller area and more concentrated damage, lower = larger area and more spread out damage | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public float Dropoff = 2f; | ||||||||||
[DataField] | ||||||||||
public int LightningArcReduction = 0; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// How much intensity can be applied per tile? | ||||||||||
/// Lightning has a charge that gauges its energy. | ||||||||||
/// This number subtracts residual charge after absorption. | ||||||||||
/// </summary> | ||||||||||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||||||||||
public float MaxTileIntensity = 5f; | ||||||||||
[DataField] | ||||||||||
public float LightningChargeReduction = 0f; | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// how much structural damage the object takes from a lightning strike | ||||||||||
/// Lightning has a charge that gauges its energy. | ||||||||||
/// This number multiplies residual charge after absorption. | ||||||||||
/// </summary> | ||||||||||
[DataField] | ||||||||||
public FixedPoint2 DamageFromLightning = 1; | ||||||||||
public float LightningChargeMultiplier = 1f; | ||||||||||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.