Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using Content.Server.DoAfter;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
using Content.Server.Mining.Components;
|
|
|
|
|
|
using Content.Shared.Damage;
|
|
|
|
|
|
using Content.Shared.Interaction;
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
using Content.Shared.Storage;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
using Robust.Shared.Audio;
|
|
|
|
|
|
using Robust.Shared.Player;
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
using Robust.Shared.Random;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Mining;
|
|
|
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class MineableSystem : EntitySystem
|
2022-01-11 19:12:08 -07:00
|
|
|
|
{
|
|
|
|
|
|
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
|
|
|
|
|
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
[Dependency] private readonly IRobustRandom _random = null!;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<MineableComponent, InteractUsingEvent>(OnInteractUsing);
|
|
|
|
|
|
SubscribeLocalEvent<MiningDoafterCancel>(OnDoafterCancel);
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
SubscribeLocalEvent<MineableComponent, MiningDoafterSuccess>(OnDoafterSuccess);
|
2022-01-11 19:12:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnInteractUsing(EntityUid uid, MineableComponent component, InteractUsingEvent args)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!TryComp<PickaxeComponent>(args.Used, out var pickaxe))
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
if (pickaxe.MiningEntities.TryGetValue(uid, out var cancelToken))
|
|
|
|
|
|
{
|
|
|
|
|
|
cancelToken.Cancel();
|
|
|
|
|
|
pickaxe.MiningEntities.Remove(uid);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-01-11 19:12:08 -07:00
|
|
|
|
// Can't mine too many entities at once.
|
|
|
|
|
|
if (pickaxe.MaxMiningEntities < pickaxe.MiningEntities.Count + 1)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
cancelToken = new CancellationTokenSource();
|
|
|
|
|
|
pickaxe.MiningEntities[uid] = cancelToken;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
var doAfter = new DoAfterEventArgs(args.User, component.BaseMineTime * pickaxe.MiningTimeMultiplier, cancelToken.Token, uid)
|
2022-01-11 19:12:08 -07:00
|
|
|
|
{
|
|
|
|
|
|
BreakOnDamage = true,
|
|
|
|
|
|
BreakOnStun = true,
|
|
|
|
|
|
BreakOnTargetMove = true,
|
|
|
|
|
|
BreakOnUserMove = true,
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
MovementThreshold = 0.25f,
|
|
|
|
|
|
BroadcastCancelledEvent = new MiningDoafterCancel { Pickaxe = args.Used, Rock = uid },
|
|
|
|
|
|
TargetFinishedEvent = new MiningDoafterSuccess { Pickaxe = args.Used, Rock = uid, Player = args.User }
|
2022-01-11 19:12:08 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
_doAfterSystem.DoAfter(doAfter);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
private void OnDoafterSuccess(EntityUid uid, MineableComponent component, MiningDoafterSuccess ev)
|
2022-01-11 19:12:08 -07:00
|
|
|
|
{
|
|
|
|
|
|
if (!TryComp(ev.Pickaxe, out PickaxeComponent? pickaxe))
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
_damageableSystem.TryChangeDamage(ev.Rock, pickaxe.Damage);
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
SoundSystem.Play(Filter.Pvs(ev.Rock, entityManager: EntityManager), pickaxe.MiningSound.GetSound(), ev.Rock);
|
2022-01-11 19:12:08 -07:00
|
|
|
|
pickaxe.MiningEntities.Remove(ev.Rock);
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
|
|
|
|
|
|
var spawnOre = EntitySpawnCollection.GetSpawns(component.Ores, _random);
|
|
|
|
|
|
var playerPos = Transform(ev.Player).MapPosition;
|
|
|
|
|
|
var spawnPos = playerPos.Offset(_random.NextVector2(0.3f));
|
|
|
|
|
|
EntityManager.SpawnEntity(spawnOre[0], spawnPos);
|
|
|
|
|
|
pickaxe.MiningEntities.Remove(uid);
|
2022-01-11 19:12:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnDoafterCancel(MiningDoafterCancel ev)
|
|
|
|
|
|
{
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
if (!TryComp<PickaxeComponent>(ev.Pickaxe, out var pickaxe))
|
2022-01-11 19:12:08 -07:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
pickaxe.MiningEntities.Remove(ev.Rock);
|
|
|
|
|
|
}
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
|
|
|
|
|
|
private sealed class MiningDoafterCancel : EntityEventArgs
|
|
|
|
|
|
{
|
|
|
|
|
|
public EntityUid Pickaxe;
|
|
|
|
|
|
public EntityUid Rock;
|
|
|
|
|
|
}
|
2022-01-11 19:12:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// grumble grumble
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class MiningDoafterSuccess : EntityEventArgs
|
2022-01-11 19:12:08 -07:00
|
|
|
|
{
|
|
|
|
|
|
public EntityUid Pickaxe;
|
|
|
|
|
|
public EntityUid Rock;
|
Salvage mining, ore processing, and material clean-up (#7406)
* adding stuff cuz new computer
* removed unused materials
* remove unused materials and such, lathe things
* material volume no longer hardcoded
* fixed mining system
* add 5 stacks of materials, and add them to the ore processor
* fix copyright for ores and handdrill
* comma momma
* whyyyyy
* more fixes to make the yaml linter happy
* i should get my eyes checked
* silver proper
* more cleanup
* leftovers
* remove more references to material doors
* couldn't bear to be without bearhide
* added uranium, added more lathe recipes
* copyright fix, stack fix
* ore processor sprite and such
* ore processing some binches
* MaterialCotton removal
* 1 uranium ore means 1 sheet
* fix merge conflict? idk
* time to ketchup
* lathe recognizes material volume again
* yaml cleanup
* forgot to remove adamantine lol
* re-added diamond for now
* diamond stacks
* functional ore processor
* added ignoreColor to lathe visuals
* ore processor machine board
* add board to industrial tech and circuit printer
* provided lathes their whitelists
* fix wonky ore spawning, added insert sound to lathe, adjusted ore chance
* re-added ore processor
* typos and cleanup
* Update Content.Client/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Update Content.Server/Lathe/LatheSystem.cs
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* revert mapchange
* VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn
* actually null canceltoken
* remove five-stacks, ore processor produces full stacks or single sheets/ingots
* VV proper
* adjust ore chances
* readd Cotton
* Update Content.Server/Mining/MineableSystem.cs
* tweaks
* Material is now dict (material, volume)
* removed unused property
* Space crystal -> space quartz
* forgor asteroid space quartz
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
|
|
|
|
public EntityUid Player;
|
2022-01-11 19:12:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|