Commit Graph

8 Commits

Author SHA1 Message Date
DamianX
63b98f26a6 Fixed a bunch of unused variables warnings (#492) 2019-12-15 14:12:23 +01:00
ZelteHonor
b2e2aef78d Rider static analysis (#433)
* Non-accessed local variable

* Merge cast and type checks.

* StringComparison.Ordinal added for better culture support

* Supposed code improvement in launcher. Remove unused code.

* Update ExplosionHelper.cs

Unintentional change.

* Optimized Import

* Add Robust.Shared.Utility import where it was deleted

* Other random suggestion

* Improve my comment
2019-11-13 23:37:46 +01:00
moneyl
427836fec9 Add basic chemical reactions (#376)
* Add basic chemical reaction system

What it adds:
- Reactions defined in yaml with an arbitrary amount of reactants (can be catalysts), products, and effects.

What it doesn't add:
- Temperature dependent reactions
- Metabolism or other medical/health effects

* Add many common SS13 chemicals and reactions

Added many of the common SS13 medicines and other chemicals, and their chemical reactions. Note that many of them are lacking their effects since we don't have medical yet.

* Add ExplosiveReactionEffect

Shows how IReactionEffect can be implemented to have effects that occur with a reaction by adding ExplosionReactionEffect and the potassium + water explosion reaction.

* Move ReactionSystem logic into SolutionComponent

No need for this to be a system currently so the behavior for reaction checking has been moved into SolutionComponent. Now it only checks for reactions when a reagent or solution is added to a solution. Also fixed a bug with SolutionValidReaction incorrectly returning true.

* Move explosion logic out of ExplosiveComponent

Allows you to create explosions without needing to add an ExplosiveComponent to an entity first.

* Add SolutionComponent.SolutionChanged event. Trigger dispenser ui updates with it.

This removes the need for SolutionComponent having a reference to the dispenser it's in. Instead the dispenser subscribes to the event and updates it's UI whenever the event is triggered.

* Add forgotten checks

`SolutionComponent.TryAddReagent` and `SolutionComponent.TryAddSolution` now check to see if `skipReactionCheck` is false before checking for a chemical reaction to avoid unnecessarily checking themselves for a reaction again when `SolutionComponent.PerformReaction` calls either of them.

* Change SolutionComponent.SolutionChanged to an Action

The arguments for event handler have no use here, and any class that can access SolutionChanged can access the SolutionComponent so it can just be an Action with no arguments instead.
2019-10-11 22:57:16 +02:00
moneyl
3e972b501a Fix explosives (#361)
Currently explosives do no damage to tiles or damage the wrong area of the map. This is because `Owner.Delete` is called before the adjacent tiles / entities are damaged. This results in the explosives grid always being 0, and it's position always being (0, 0), meaning that the tiles in range of the explosive are not properly calculated. This fixes that (Issue #358).
2019-09-24 09:54:24 +02:00
DamianX
4dcbf28714 IoC'd random (#302)
* Implemented RobustRandom

* update submodule

* update submodule

* Fix benchmark
2019-08-17 12:09:09 -07:00
Pieter-Jan Briers
ceb8cc8421 Use automatic component registration. 2019-07-31 15:07:54 +02:00
Pieter-Jan Briers
8ff4c22f42 Polish explosions somewhat.
Just makes them less ugly. Slightly.
2019-07-07 00:39:00 +02:00
Injazz
10801af2f7 Explosions and Grenades, Triggers, OnDestroy, OnExAct, Fueltanks and destructible tables (#247)
* initial explosiveComponent

* remove garbagee

* assets

* tile mass deletion baby

* grenades

* tweaks

* Update Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs

Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Ex_act based on damage, fixes and tweaks

* One finishing touch

Done the most cringe way

* ex_act explosions, tables are destructible now

also adds fuel tanks

* adds ex_act to mobs
2019-06-07 13:15:20 +02:00