diff --git a/.gitignore b/.gitignore
index ec5e2fa..41e72cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -369,3 +369,5 @@ Source/Content/Unity/RimVibes Bundles/AssetBundles/
Source/Content/Unity/RimVibes Bundles/Library/
Source/packages/
+
+Source/Content/Unity/RimVibes Bundles/Temp/
diff --git a/About/About.xml b/About/About.xml
index da2b568..0322c2c 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -8,14 +8,16 @@
https://github.com/Epicguru/AntimatterAnnihilation
-<size=24>Adds many high tech items, weapons and materials to the game. Weild the technology that glitterworlds could only dream of.</size>
+<size=24>Adds many high tech items, weapons and materials to the game.</size>
Adds many items, weapons, defences, utility buildings, and a new powerful faction that all revolve around Antimatter technology.
-This is an end-game mod: you will require loads of resources, highly skilled colonists and lots of research to unlock the secrets of antimatter. However, once you do, you can challenge even the power of the Ultratech faction, who will attack you to take back the technology that they consider theirs.
This is a mod that is intended to expand the end-game, adding new goals that are challenging but rewarding, and also to increase the difficulty of late game by sending harder raiders.
+This mod also features a fully developed in-game wiki that serves as a guide and also a little extra lore and pretty pictures.
+
+Should be loaded far down as possible, and always after Harmony, In-Game wiki and Core.
This is a WIP mod. There may be bugs and things may break. Please report bugs on the steam page or on Github, providing as much detail as possible, thanks.
-See the store page for all plans.
+See the store page for all plans, and don't hesitate to suggest new features or changes.
diff --git a/About/Preview.png b/About/Preview.png
index dc9bba9..3d62eb5 100644
Binary files a/About/Preview.png and b/About/Preview.png differ
diff --git a/About/PublishedFileId.txt b/About/PublishedFileId.txt
new file mode 100644
index 0000000..02d33c4
--- /dev/null
+++ b/About/PublishedFileId.txt
@@ -0,0 +1 @@
+2113692574
\ No newline at end of file
diff --git a/AssetBundles/aa b/AssetBundles/aa
index eaed5bb..7593d69 100644
Binary files a/AssetBundles/aa and b/AssetBundles/aa differ
diff --git a/AssetBundles/aa.manifest b/AssetBundles/aa.manifest
index 2738514..65f4858 100644
--- a/AssetBundles/aa.manifest
+++ b/AssetBundles/aa.manifest
@@ -1,9 +1,9 @@
ManifestFileVersion: 0
-CRC: 1684284641
+CRC: 3074336766
Hashes:
AssetFileHash:
serializedVersion: 2
- Hash: 44b8a3b422ac272c36304d8eb1af96f9
+ Hash: 5b9c09cc23f32928bf42d0bfd3732f87
TypeTreeHash:
serializedVersion: 2
Hash: fb95f860f6de44335a97c1723d17ea56
@@ -44,6 +44,7 @@ ClassTypes:
Assets:
- Assets/UpBeam.prefab
- Assets/Shaders/OuterPrefab.prefab
+- Assets/MegCharge.prefab
- Assets/Shaders/Out Beam.prefab
- Assets/RailgunEffect.prefab
- Assets/Shaders/In Beam.prefab
diff --git a/Credits.txt b/Credits.txt
index d943578..2d22335 100644
--- a/Credits.txt
+++ b/Credits.txt
@@ -14,5 +14,6 @@ Sound Effects & Music - Freesound.org users:
-Anomaex (Huge explosion N2 mine)
-JavierZumer (Railgun charge)
-dpren (Railgun charge/fire, gun shoot sounds)
+ -SuperPhat (Devastator sniper rifle)
All sounds used were posted under the Creative Commons or Attribution liscences.
\ No newline at end of file
diff --git a/Defs/Armor/VoidArmor.xml b/Defs/Armor/VoidArmor.xml
index c32b876..1a489ad 100644
--- a/Defs/Armor/VoidArmor.xml
+++ b/Defs/Armor/VoidArmor.xml
@@ -5,7 +5,7 @@
SpacerUnfinishedTechArmor
- VoidArmor_AA
+ R_VoidArmor_AA12
diff --git a/Defs/Armor/VoidHelmet.xml b/Defs/Armor/VoidHelmet.xml
index 233027a..7f6490b 100644
--- a/Defs/Armor/VoidHelmet.xml
+++ b/Defs/Armor/VoidHelmet.xml
@@ -5,7 +5,7 @@
SpacerUnfinishedTechArmor
- VoidArmor_AA
+ R_VoidArmor_AA12
diff --git a/Defs/Buildings/Buildings.xml b/Defs/Buildings/Buildings.xml
index 615fb4e..e776b60 100644
--- a/Defs/Buildings/Buildings.xml
+++ b/Defs/Buildings/Buildings.xml
@@ -38,7 +38,7 @@
false
- 12
+ 6
@@ -74,6 +74,7 @@
True(0,0,-5)
+
CompPowerTrader4000
@@ -144,6 +145,7 @@ Requires a Reactor Injector to inject antimatter, and a Reactor Power Converter
(51,124,193,255)
+ 8
R_Reactor_AA
@@ -161,6 +163,10 @@ If the beam is fired without a reactor to collect it, the fired anti-matter will
Graphic_Multi(2,3)
+ MinifiedThing
+
+
BuildingsMisc
+ trueEastImpassable
@@ -192,6 +198,7 @@ If the beam is fired without a reactor to collect it, the fired anti-matter will
20
+ 8
R_ReactorInjector_AA
@@ -207,6 +214,10 @@ If the beam is fired without a reactor to collect it, the fired anti-matter will
Graphic_Multi(2,3)
+ MinifiedThing
+
+
BuildingsPower
+ trueWestImpassable
@@ -226,6 +237,7 @@ If the beam is fired without a reactor to collect it, the fired anti-matter will
true
+ 8
R_Reactor_AA
@@ -242,6 +254,10 @@ Also has the ability to switch machines on or off remotely.
Graphic_Multi(1,1)
+ MinifiedThing
+
+
BuildingsPower
+ trueSouthPassThroughOnly
@@ -258,6 +274,7 @@ Also has the ability to switch machines on or off remotely.
false
+ 2
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Buildings/Production/AlloyFusionMachine.xml b/Defs/Buildings/Production/AlloyFusionMachine.xml
new file mode 100644
index 0000000..ebcead2
--- /dev/null
+++ b/Defs/Buildings/Production/AlloyFusionMachine.xml
@@ -0,0 +1,48 @@
+
+
+
+
+ AlloyFusionMachine_AA
+ AntimatterAnnihilation.Buildings.Building_AlloyFusionMachine
+
+ Fuses dense metals together using huge amounts of power to create advanced metal alloys, such as Hyper Alloy.
+
+See the in-game wiki for more information and how to use.
+
+ AntimatterAnnihilation/Buildings/AlloyFusionMachine/Idle
+ Graphic_Single
+ (3,3)
+
+ RealtimeOnly
+ PassThroughOnly
+ true
+ (3, 3)
+
+ 350
+ 150
+ 8
+ 4
+
+ MinifiedThing
+
+
BuildingsProduction
+
+
+
+
+ CompPowerTrader
+ 300
+ false
+
+
+ 6
+ (255,248,214,255)
+
+
+ 10
+
+
R_HyperAlloy_AA
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Buildings/Production/CompositeRefiner.xml b/Defs/Buildings/Production/CompositeRefiner.xml
index d643bbf..f52791a 100644
--- a/Defs/Buildings/Production/CompositeRefiner.xml
+++ b/Defs/Buildings/Production/CompositeRefiner.xml
@@ -24,16 +24,25 @@ See the in-game wiki for more information and how to use.
61
+ MinifiedThing
+
+
BuildingsProduction
+
-
-
- CompPowerTrader
- 1500
- false
-
+
+
+ CompPowerTrader
+ 1500
+ false
+
+
+ 5
+ (245,198,255,255)
+
+ 7
-
AntimatterComposite_AA
+
R_AntimatterComposite_AA
diff --git a/Defs/Buildings/Production/InputTray.xml b/Defs/Buildings/Production/InputTray.xml
index 165f3a3..2da944a 100644
--- a/Defs/Buildings/Production/InputTray.xml
+++ b/Defs/Buildings/Production/InputTray.xml
@@ -16,7 +16,7 @@
true70
- 25
+ 20140
diff --git a/Defs/Buildings/Misc/M3G_UMIN.xml b/Defs/Buildings/Special/M3G_UMIN.xml
similarity index 68%
rename from Defs/Buildings/Misc/M3G_UMIN.xml
rename to Defs/Buildings/Special/M3G_UMIN.xml
index 9f81503..c83a79d 100644
--- a/Defs/Buildings/Misc/M3G_UMIN.xml
+++ b/Defs/Buildings/Special/M3G_UMIN.xml
@@ -28,6 +28,10 @@ Firing the beam of energy creates a huge electromagnetic pulse in both the area
228
+ MinifiedThing
+
+
BuildingsSecurity
+
@@ -50,10 +54,17 @@ Firing the beam of energy creates a huge electromagnetic pulse in both the area
falsefalse
+
+ 9
+ (255,232,142,255)
+
R_Megumin_AA
+
+
PlaceWorker_NotUnderRoof
+
@@ -125,68 +136,4 @@ Firing the beam of energy creates a huge electromagnetic pulse in both the area
-
- GreedyBattery
-
- Stores electricity for later use. Charged batteries explode when exposed to rain or fire.
- Building_Battery
-
- Things/Building/Power/Battery
- Graphic_Multi
- (2,3)
-
- Damage/Corner
- Damage/Corner
- Damage/Corner
- Damage/Corner
-
-
- Building
- PassThroughOnly
- 70
- true
- true
- 0.40
- Normal
- MinifiedThing
-
-
@@ -38,8 +38,8 @@
trueBullet_AntimatterGrenade_AA4.5
- 20
- 2
+ 23.9
+ 11Shot_IncendiaryLauncherGunTail_Medium
diff --git a/Defs/Items/Guns/DevastatorSmartGun.xml b/Defs/Items/Guns/DevastatorSmartGun.xml
new file mode 100644
index 0000000..9b67215
--- /dev/null
+++ b/Defs/Items/Guns/DevastatorSmartGun.xml
@@ -0,0 +1,74 @@
+
+
+
+
+ DevastatorSmartGun_AA
+
+ A heavy antimatter weapon that uses archotech technology to increase shooting accuracy far beyond human capabilities. Fires a large burst.
+This weapon incorporates archotech technology. Even with a good understanding of Antimatter tech, this is still incredibly advanced, and can't be crafted using any known means.
+
+ AntimatterAnnihilation/Weapons/DevastatorSmartGun
+ Graphic_Single
+
+
+ 4.8
+ 0.75
+ 0.9
+ 0.8
+ 0.7
+ 2.5
+ 5200
+
+ 0
+
+
+
+
+
+
+ Bullet_DevastatorSmartGun_AA
+
+
+ Things/Projectile/Charge_Small
+ Graphic_Single
+
+
+ Annihilate_AA
+ 6
+ 1.0
+ 0.4
+ 90
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Items/Guns/DevastatorSniperRifle.xml b/Defs/Items/Guns/DevastatorSniperRifle.xml
new file mode 100644
index 0000000..50e54ef
--- /dev/null
+++ b/Defs/Items/Guns/DevastatorSniperRifle.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ DevastatorSniperRifle_AA
+
+ A heavy antimatter weapon that deals huge damage over very long ranges.
+This weapon incorporates archotech technology. Even with a good understanding of Antimatter tech, this is still incredibly advanced, and can't be crafted using any known means.
+
+ AntimatterAnnihilation/Weapons/DSR
+ Graphic_Single
+
+ 33.5
+
+
+
+
+
+
+ Bullet_DevastatorSniperRifle_AA
+
+
+ Things/Projectile/Charge_Small
+ Graphic_Single
+
+
+ Annihilate_AA
+ 3
+ 55
+ 0.85
+ 200
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Items/Resources/AntimatterComposite.xml b/Defs/Items/Resources/AntimatterComposite.xml
index 09a2e87..7566c2b 100644
--- a/Defs/Items/Resources/AntimatterComposite.xml
+++ b/Defs/Items/Resources/AntimatterComposite.xml
@@ -16,6 +16,7 @@ This material has the ability to cause microscopic annihilation reactions when t
Metal_Dropfalsefalse
+ Sellable260.6
diff --git a/Defs/Items/Resources/HyperAlloy.xml b/Defs/Items/Resources/HyperAlloy.xml
new file mode 100644
index 0000000..b18859e
--- /dev/null
+++ b/Defs/Items/Resources/HyperAlloy.xml
@@ -0,0 +1,64 @@
+
+
+
+
+ HyperAlloy_AA
+
+ 75
+ Ingots of hyper alloy, a material with incredible strength and striking beauty.
+
+This material is a fusion of Antimatter Composite, Gold and small amounts of Uranium to create a hyper-dense, ultra resistant material.
+
+ AntimatterAnnihilation/Items/HyperAlloy
+ Graphic_StackCount
+
+ Metal_Drop
+ Metal_Drop
+ false
+ false
+ Sellable
+
+ 240
+ 0.8
+ 3
+ 2.5
+ 2.5
+ 3
+ 3
+ 5
+ 7
+
+
+
ResourcesRaw
+
+ 0
+ false
+ true
+
+
+
Metallic
+
+
+ 12
+
+ 0
+ ConstructMetal
+ (255,209,0)
+ BulletImpact_Metal
+ MeleeHit_Metal_Sharp
+ MeleeHit_Metal_Blunt
+
+ 12
+ 8
+ 0
+ 4
+ 4.5
+ 0.5
+ 5
+ 2.5
+
+
+ Medium
+
+
+
\ No newline at end of file
diff --git a/Defs/Motes/MuzzleFlashMote.xml b/Defs/Motes/MuzzleFlashMote.xml
new file mode 100644
index 0000000..125c4ec
--- /dev/null
+++ b/Defs/Motes/MuzzleFlashMote.xml
@@ -0,0 +1,34 @@
+
+
+
+
+ Mote_LargeMuzzleFlash_AA
+
+ AntimatterAnnihilation/Motes/MuzzleFlash
+ MoteGlow
+
+ MoteOverhead
+ true
+
+ 0.1
+ 0
+ 0.15
+
+
+
+
+ Mote_LargeMuzzleFlashFast_AA
+
+ AntimatterAnnihilation/Motes/MuzzleFlash
+ MoteGlow
+
+ MoteOverhead
+ true
+
+ 0.05
+ 0
+ 0.1
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Research/AT Fields.xml b/Defs/Research/AT Fields Research.xml
similarity index 100%
rename from Defs/Research/AT Fields.xml
rename to Defs/Research/AT Fields Research.xml
diff --git a/Defs/Research/Antimatter Composite.xml b/Defs/Research/Antimatter Composite Research.xml
similarity index 94%
rename from Defs/Research/Antimatter Composite.xml
rename to Defs/Research/Antimatter Composite Research.xml
index 6e2554f..7ff4bd3 100644
--- a/Defs/Research/Antimatter Composite.xml
+++ b/Defs/Research/Antimatter Composite Research.xml
@@ -2,7 +2,7 @@
- AntimatterComposite_AA
+ R_AntimatterComposite_AABy combining Plasteel and Antimatter Canisters you can create Antimatter Composite, a super-durable material that is used to create many powerful weapons and buildings.3500
diff --git a/Defs/Research/Antimatter Explosives.xml b/Defs/Research/Antimatter Explosives Research.xml
similarity index 100%
rename from Defs/Research/Antimatter Explosives.xml
rename to Defs/Research/Antimatter Explosives Research.xml
diff --git a/Defs/Research/Antimatter Long Ranged.xml b/Defs/Research/Antimatter Long Ranged Research.xml
similarity index 100%
rename from Defs/Research/Antimatter Long Ranged.xml
rename to Defs/Research/Antimatter Long Ranged Research.xml
diff --git a/Defs/Research/Antimatter Medium Ranged.xml b/Defs/Research/Antimatter Medium Ranged Research.xml
similarity index 100%
rename from Defs/Research/Antimatter Medium Ranged.xml
rename to Defs/Research/Antimatter Medium Ranged Research.xml
diff --git a/Defs/Research/Entry.xml b/Defs/Research/Entry Research.xml
similarity index 100%
rename from Defs/Research/Entry.xml
rename to Defs/Research/Entry Research.xml
diff --git a/Defs/Research/Hyper Alloy Research.xml b/Defs/Research/Hyper Alloy Research.xml
new file mode 100644
index 0000000..e2cf984
--- /dev/null
+++ b/Defs/Research/Hyper Alloy Research.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ R_HyperAlloy_AA
+
+ Data indicates that alloying Antimatter Composite with other dense metals could produce a material of extreme strength and versatility.\nDoing so will require a specialized production facility.
+ 5500
+ Ultra
+ Antimatter
+ About hyper alloy
+ Your research has lead you to the discovery of Hyper Alloy, an alloy of gold, uranium and antimatter composite.
+Data suggests that it will have incredible properties that would make it far superior to any alternative in terms of strength and versatility.
+In order to manufacture it, a special facility will be needed.
+ HiTechResearchBench
+
+
MultiAnalyzer
+
+
+
R_HyperComponents_AA
+
+ 4.00
+ 2.50
+
+
+
\ No newline at end of file
diff --git a/Defs/Research/Hyper Components Research.xml b/Defs/Research/Hyper Components Research.xml
new file mode 100644
index 0000000..ca483a2
--- /dev/null
+++ b/Defs/Research/Hyper Components Research.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ R_HyperComponents_AA
+
+ Investigate the uses of Hyper Components.
+Hyper components combine antimatter and archotech technology, but you don't quite understand how. Crafting these components will be impossible, but you might be able to use them if you somehow get your hands on them.
+The Ultratech faction may have some, but they won't give them up voluntarily...
+ 3300
+ Ultra
+ Hyper components
+ You have now analyzed the data on Hyper Components.
+You can use Hyper Components to build the most advanced defenses and production facilites, but you will have to steal them off the Ultratech faction.
+
+Ultratech raiders will ocasionally carry them, and you can also attack Ultratech bases to find more hyper components.
+ Antimatter
+ HiTechResearchBench
+
+
MultiAnalyzer
+
+
+
ATFields_AA
+
+ 3.00
+ 3.15
+
+
+
\ No newline at end of file
diff --git a/Defs/Research/Hyper Components.xml b/Defs/Research/Hyper Components.xml
deleted file mode 100644
index 89e1931..0000000
--- a/Defs/Research/Hyper Components.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- R_HyperComponents_AA
-
- Of all the data grabbed in the initial Ultratech hack, the data about Hyper Components may be the most interesting and confusing.
-Hyper components appear to combine antimatter and archotech technology, but you don't quite understand how. It is obvious that crafting these components will be impossible, but you might be able to use them if you somehow get your hands on them.
-The Ultratech faction may have some, but they won't give them up voluntarily...
- 3300
- Ultra
- Antimatter
- HiTechResearchBench
-
-
MultiAnalyzer
-
-
-
ATFields_AA
-
- 3.00
- 2.80
-
-
-
\ No newline at end of file
diff --git a/Defs/Research/Instant Flick Research.xml b/Defs/Research/Instant Flick Research.xml
new file mode 100644
index 0000000..a902820
--- /dev/null
+++ b/Defs/Research/Instant Flick Research.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ InstantFlick_AA
+
+ Using the PowerNet Console, send a signal directly through the power lines to instantly turn machines on or off.
+ 400
+ Industrial
+ Antimatter
+ HiTechResearchBench
+
+
Entry_AA
+
+ 1.00
+ 1.45
+
+
+
\ No newline at end of file
diff --git a/Defs/Research/MBD Research.xml b/Defs/Research/MBD Research.xml
new file mode 100644
index 0000000..e287e70
--- /dev/null
+++ b/Defs/Research/MBD Research.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ R_MBD_AA
+
+ Build a turret that takes the principles of the thunder gun and adds even more barrels for even more destruction.
+ 3600
+ Ultra
+ Antimatter
+ MBD
+ You now understand how to construct multi-barreled antimatter cannons.
+Using hyper components allows for incredibly accurate control over channeling and flow of antimatter in a multi-barrel system, resulting in a blazing rate of fire and a huge damage output.
+ HiTechResearchBench
+
+
MultiAnalyzer
+
+
+
ThunderGun_AA
+
+ 3.00
+ 5.05
+
+
+
\ No newline at end of file
diff --git a/Defs/Research/Megumin Research.xml b/Defs/Research/Megumin Research.xml
index 550d14f..152ac35 100644
--- a/Defs/Research/Megumin Research.xml
+++ b/Defs/Research/Megumin Research.xml
@@ -10,6 +10,10 @@ Hyper components will be required to create and maintain an AT field going from
UltraAntimatterHiTechResearchBench
+ M3G_UMIN
+ You can now construct the M3G_UMIN, once you aquire enough Hyper Components.
+The M3G_UMIN will not automatically attack enemies, because it is too destructive. It uses antimatter canisters to fire, and has a very long cooldown.
+Don't target anything near something you care about loosing!
MultiAnalyzer
@@ -17,7 +21,7 @@ Hyper components will be required to create and maintain an AT field going from
R_HyperComponents_AA
4.00
- 2.80
+ 3.15
\ No newline at end of file
diff --git a/Defs/Research/Melee Industrial Advanced.xml b/Defs/Research/Melee Industrial Advanced Research.xml
similarity index 100%
rename from Defs/Research/Melee Industrial Advanced.xml
rename to Defs/Research/Melee Industrial Advanced Research.xml
diff --git a/Defs/Research/Melee Spacer Advanced.xml b/Defs/Research/Melee Spacer Advanced Research.xml
similarity index 94%
rename from Defs/Research/Melee Spacer Advanced.xml
rename to Defs/Research/Melee Spacer Advanced Research.xml
index f18df60..e30c5f6 100644
--- a/Defs/Research/Melee Spacer Advanced.xml
+++ b/Defs/Research/Melee Spacer Advanced Research.xml
@@ -14,7 +14,7 @@
MeleeIndustrialAdvanced_AA
-
AntimatterComposite_AA
+
R_AntimatterComposite_AA
3.000.20
diff --git a/Defs/Research/Particle Accelerators.xml b/Defs/Research/Particle Accelerators Research.xml
similarity index 100%
rename from Defs/Research/Particle Accelerators.xml
rename to Defs/Research/Particle Accelerators Research.xml
diff --git a/Defs/Research/Railgun.xml b/Defs/Research/Railgun Research.xml
similarity index 57%
rename from Defs/Research/Railgun.xml
rename to Defs/Research/Railgun Research.xml
index 7d2c12f..06701f4 100644
--- a/Defs/Research/Railgun.xml
+++ b/Defs/Research/Railgun Research.xml
@@ -8,16 +8,21 @@
4200UltraAntimatter
+ Antimatter railgun
+ You now understand how to construct antimatter railguns.
+Antimatter railguns make convential projectile launchers seem primitive. They fire antimatter channeled through an AT field, giving it a theoretically infinite range and dealing massive damage in the impact area.
+
+You will need to aquire Hyper Components to build them.HiTechResearchBench
MultiAnalyzer
ThunderGun_AA
-
ATFields_AA
+
R_HyperComponents_AA
- 3.00
- 4.90
+ 4.00
+ 3.85
\ No newline at end of file
diff --git a/Defs/Research/Reactor Injector.xml b/Defs/Research/Reactor Injector Research.xml
similarity index 100%
rename from Defs/Research/Reactor Injector.xml
rename to Defs/Research/Reactor Injector Research.xml
diff --git a/Defs/Research/Reactor.xml b/Defs/Research/Reactor Research.xml
similarity index 62%
rename from Defs/Research/Reactor.xml
rename to Defs/Research/Reactor Research.xml
index ee9a74c..45c2b6d 100644
--- a/Defs/Research/Reactor.xml
+++ b/Defs/Research/Reactor Research.xml
@@ -8,6 +8,10 @@
3600SpacerAntimatter
+ About the antimatter reactor
+ You can now construct an antimatter reactor, but setting it up correctly is a little tricky.
+The reactor itself is very large and requires additional space around it for an injector and a power converter. Remember that the reactor can be rotated to suit your preferences.
+See the in-game wiki page for exact instructions on how to set up.HiTechResearchBench
MultiAnalyzer
diff --git a/Defs/Research/Thunder Gun.xml b/Defs/Research/Thunder Gun Research.xml
similarity index 100%
rename from Defs/Research/Thunder Gun.xml
rename to Defs/Research/Thunder Gun Research.xml
diff --git a/Defs/Research/Turrets.xml b/Defs/Research/Turrets Research.xml
similarity index 100%
rename from Defs/Research/Turrets.xml
rename to Defs/Research/Turrets Research.xml
diff --git a/Defs/Research/Void Armor Research.xml b/Defs/Research/Void Armor Research.xml
index e7745a7..54e0144 100644
--- a/Defs/Research/Void Armor Research.xml
+++ b/Defs/Research/Void Armor Research.xml
@@ -2,7 +2,7 @@
- VoidArmor_AA
+ R_VoidArmor_AAUse antimatter composite to create very powerful armor and headgear.3500
@@ -13,10 +13,10 @@
MultiAnalyzer
-
AntimatterComposite_AA
+
R_AntimatterComposite_AA
4.00
- 1.00
+ 1.05
\ No newline at end of file
diff --git a/Defs/Sounds/Lasers.xml b/Defs/Sounds/Lasers.xml
index be9fbe5..4acbdfa 100644
--- a/Defs/Sounds/Lasers.xml
+++ b/Defs/Sounds/Lasers.xml
@@ -45,4 +45,22 @@
+
+ LaserHum_AA
+ true
+ MapOnly
+ PrioritizeNearest
+
+
+
+
+ AntimatterAnnihilation/LaserHum
+
+
+ 18
+ 10~40
+
+
+
+
\ No newline at end of file
diff --git a/Defs/Sounds/Shots.xml b/Defs/Sounds/Shots.xml
index f3ee761..840383a 100644
--- a/Defs/Sounds/Shots.xml
+++ b/Defs/Sounds/Shots.xml
@@ -3,7 +3,7 @@
Shot_AntimatterBlaster_AAMapOnly
- 1
+ 2
@@ -16,6 +16,22 @@
+
+ Shot_HeavySniper_AA
+ MapOnly
+ 2
+
+
+
+
+ AntimatterAnnihilation/HeavySniper
+
+
+ 0.95~1
+
+
+
+
Melee_GalvaknucklesDischarge_AAMapOnly
diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml
index 35dd0c0..441e841 100644
--- a/Languages/English/Keyed/Keys.xml
+++ b/Languages/English/Keyed/Keys.xml
@@ -5,21 +5,40 @@
onoffenabled
+active
+not activeturnnamepower
+
+
antimatter
+antimatter composite
+gold
+uraniumplasteel
+
+north
+east
+south
+west
+
hoursdaysquadrums
+
+Power generation multiplier: {0}%
+Fuel consumption multiplier: {0}%
+Enable easter eggs:
+
Open consoleShows detailed information about the connected power network, and allows you to turn power on and off.PowerNet Info
+Instant flick active!KWKWMW
@@ -32,7 +51,7 @@
Toggle auto attack
-Toggle whether this {0} will automatically attack enemies
+Toggle whether this {0} will automatically attack enemies.Not enough power.
@@ -62,4 +81,27 @@
Not running: No powerNot running: No plasteel fuel
+
+Output side: {0}
+Change output side
+Change the side where the output goes. The inputs go on the 3 other sides.
+{0} is in the output spot ({1}), move it to an input spot or change the output direction.
+Stored: {0}/{1} gold, {2}/{3} antimatter composite, {4}/{5} uranium.
+Running: {0} hours until output.
+Not running: No power.
+Not running: Required min. {0} gold, {1} composite, {2} uranium.
+Change power level
+Current power level: {0}% speed, uses {1} watts.\nChange in power level only takes effect once the current alloy is completed.
+
+
+Change power level
+Current power level: {0}%, consumes {1} canisters per day.
+
+
+Set for {0}
+Configures this tray to store {0} with an 'important' priority.
+Configured to store: {0}
+Nothing
+Multiple
+
\ No newline at end of file
diff --git a/Sounds/AntimatterAnnihilation/HeavySniper.ogg b/Sounds/AntimatterAnnihilation/HeavySniper.ogg
new file mode 100644
index 0000000..7cfa870
Binary files /dev/null and b/Sounds/AntimatterAnnihilation/HeavySniper.ogg differ
diff --git a/Sounds/AntimatterAnnihilation/LaserHum.ogg b/Sounds/AntimatterAnnihilation/LaserHum.ogg
new file mode 100644
index 0000000..647e0e2
Binary files /dev/null and b/Sounds/AntimatterAnnihilation/LaserHum.ogg differ
diff --git a/Source/AntimatterAnnihilation/AntimatterAnnihilation.csproj b/Source/AntimatterAnnihilation/AntimatterAnnihilation.csproj
index 404a4b6..16eaa32 100644
--- a/Source/AntimatterAnnihilation/AntimatterAnnihilation.csproj
+++ b/Source/AntimatterAnnihilation/AntimatterAnnihilation.csproj
@@ -40,7 +40,7 @@
False
- ..\packages\Lib.InGameWiki.1.0.0\lib\net472\net472\Lib.InGameWiki.dll
+ ..\packages\Lib.InGameWiki.1.2.0\lib\net472\net472\Lib.InGameWiki.dllFalse
@@ -97,6 +97,7 @@
+
@@ -104,8 +105,11 @@
+
+
+
@@ -117,11 +121,13 @@
+
+
@@ -140,6 +146,7 @@
+
diff --git a/Source/AntimatterAnnihilation/Buildings/AATurretTop.cs b/Source/AntimatterAnnihilation/Buildings/AATurretTop.cs
index 96bbd92..1248f05 100644
--- a/Source/AntimatterAnnihilation/Buildings/AATurretTop.cs
+++ b/Source/AntimatterAnnihilation/Buildings/AATurretTop.cs
@@ -19,7 +19,11 @@ public float AngleToTarget
{
get
{
- return (parentTurret.CurrentOrForcedTarget.Cell.ToVector3Shifted() - parentTurret.DrawPos).AngleFlat();
+ Vector3 targetPos = parentTurret.CurrentOrForcedTarget.CenterVector3;
+ targetPos.y = 0f;
+ Vector3 drawPos = parentTurret.DrawPos;
+ drawPos.y = 0f;
+ return (targetPos - drawPos).AngleFlat();
}
}
public Vector3 LocalDrawOffset { get; protected set; }
@@ -78,7 +82,7 @@ public virtual void Draw()
Vector3 b = (new Vector3(this.parentTurret.def.building.turretTopOffset.x, 0f, this.parentTurret.def.building.turretTopOffset.y) + LocalDrawOffset).RotatedBy(this.CurrentRotation);
float turretTopDrawSize = this.parentTurret.def.building.turretTopDrawSize;
Matrix4x4 matrix = default(Matrix4x4);
- matrix.SetTRS(this.parentTurret.DrawPos + Altitudes.AltIncVect + b, (this.CurrentRotation + (float)TurretTop.ArtworkRotation).ToQuat(), new Vector3(turretTopDrawSize, 1f, turretTopDrawSize));
+ matrix.SetTRS(this.parentTurret.DrawPos + b + Altitudes.AltIncVect, (this.CurrentRotation + (float)TurretTop.ArtworkRotation).ToQuat(), new Vector3(turretTopDrawSize, 1f, turretTopDrawSize));
Graphics.DrawMesh(MeshPool.plane10, matrix, this.parentTurret.def.building.turretTopMat, 0);
}
@@ -116,6 +120,11 @@ private void RotateTo()
CurrentRotation -= Mathf.Min(-delta, DT * RotationSpeed);
}
}
+
+ public virtual void ExposeData()
+ {
+
+ }
}
public class PlaceWorker_ShowAATurretRadius : PlaceWorker
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_AATurret.cs b/Source/AntimatterAnnihilation/Buildings/Building_AATurret.cs
index 9e6c7ad..abe0c9a 100644
--- a/Source/AntimatterAnnihilation/Buildings/Building_AATurret.cs
+++ b/Source/AntimatterAnnihilation/Buildings/Building_AATurret.cs
@@ -87,6 +87,13 @@ public bool IsMannable
return this.mannableComp != null;
}
}
+ public bool IsInBurst
+ {
+ get
+ {
+ return isInBurst;
+ }
+ }
private bool WarmingUp
{
@@ -160,6 +167,7 @@ private bool MannedByNonColonist
}
private StringBuilder stringBuilder = new StringBuilder();
+ private bool isInBurst;
public Building_AATurret()
{
@@ -204,6 +212,7 @@ public override void ExposeData()
Scribe_Values.Look(ref this.burstWarmupTicksLeft, "burstWarmupTicksLeft", 0, false);
Scribe_Values.Look(ref this.top.curRotationInt, "aa_turretTopRot");
+ Scribe_Values.Look(ref isInBurst, "aa_isInBurst");
Scribe_TargetInfo.Look(ref this.currentTargetInt, "currentTarget");
Scribe_Values.Look(ref this.holdFire, "holdFire", false, false);
@@ -213,7 +222,12 @@ public override void ExposeData()
{
this.UpdateGunVerbs();
}
- }
+
+ if (top != null)
+ top.ExposeData();
+ else
+ Log.Error("Could not expose data for turret top: turret top is null.");
+ }
public override bool ClaimableBy(Faction by)
{
@@ -429,11 +443,18 @@ protected void BeginBurst()
{
this.AttackVerb.TryStartCastOn(this.CurrentTarget, false, true);
base.OnAttackedTarget(this.CurrentTarget);
- }
+ //if (isInBurst)
+ // Log.Error("BeginBurst() but isInBurst was true?!");
+ isInBurst = true;
+ }
protected void BurstComplete()
{
this.burstCooldownTicksLeft = this.BurstCooldownTime().SecondsToTicks();
+ //if (!isInBurst)
+ // Log.Error("BurstComplete() but isInBurst was false?!");
+
+ isInBurst = false;
}
protected float BurstCooldownTime()
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_AlloyFusionMachine.cs b/Source/AntimatterAnnihilation/Buildings/Building_AlloyFusionMachine.cs
new file mode 100644
index 0000000..f89feda
--- /dev/null
+++ b/Source/AntimatterAnnihilation/Buildings/Building_AlloyFusionMachine.cs
@@ -0,0 +1,441 @@
+using System;
+using System.Collections.Generic;
+using AntimatterAnnihilation.Utils;
+using RimWorld;
+using UnityEngine;
+using Verse;
+
+namespace AntimatterAnnihilation.Buildings
+{
+ public class Building_AlloyFusionMachine : Building_TrayPuller, IConditionalGlower
+ {
+ public const int TICKS_PER_FRAME = 3;
+ public const int FRAME_COUNT = 20;
+ public const int FRAME_STEP = 3;
+
+ public const int PULL_INTERVAL = 120;
+ public const int TICKS_PER_HYPER = 2500; // 1 hour.
+
+ public const int GOLD_PER_HYPER = 4;
+ public const int COMPOSITE_PER_HYPER = 3;
+ public const int URANIUM_PER_HYPER = 2;
+
+ public const float POWER_DRAW_NORMAL = 4500; // 1x speed
+ public const float POWER_DRAW_OVERCLOCKED = POWER_DRAW_NORMAL * 2 + 1000; // 2x speed
+ public const float POWER_DRAW_INSANITY = POWER_DRAW_NORMAL * 4 + 5000; // 4x speed
+
+ public const int MAX_GOLD_STORED = GOLD_PER_HYPER * 4;
+ public const int MAX_COMPOSITE_STORED = COMPOSITE_PER_HYPER * 4;
+ public const int MAX_URANIUM_STORED = URANIUM_PER_HYPER * 4;
+
+ private static Graphic[] activeGraphics;
+
+ private static void LoadGraphics(Building thing)
+ {
+ activeGraphics = new Graphic[FRAME_COUNT];
+ for (int i = 0; i < FRAME_COUNT; i++)
+ {
+ var gd = thing.DefaultGraphic.data;
+ string num = (i * FRAME_STEP).ToString();
+ while (num.Length < 4)
+ num = '0' + num;
+ activeGraphics[i] = GraphicDatabase.Get(gd.graphicClass, $"AntimatterAnnihilation/Buildings/AlloyFusionMachine/{num}", gd.shaderType.Shader, gd.drawSize, Color.white, Color.white);
+ }
+ }
+
+ public CompGlower CompGlower
+ {
+ get
+ {
+ if (_compGlower == null)
+ _compGlower = this.TryGetComp();
+
+ return _compGlower;
+ }
+ }
+ private CompGlower _compGlower;
+ public CompPowerTrader PowerTraderComp
+ {
+ get
+ {
+ if (_powerTraderComp == null)
+ this._powerTraderComp = GetComp();
+ return _powerTraderComp;
+ }
+ }
+ private CompPowerTrader _powerTraderComp;
+ public override Graphic Graphic
+ {
+ get
+ {
+ return activeGraphic ?? base.DefaultGraphic;
+ }
+ }
+ public bool IsActive
+ {
+ get
+ {
+ return isActiveInt;
+ }
+ protected set
+ {
+ isActiveInt = value;
+ }
+ }
+ public int GoldToFill
+ {
+ get
+ {
+ return MAX_GOLD_STORED - storedGold;
+ }
+ }
+ public int CompositeToFill
+ {
+ get
+ {
+ return MAX_COMPOSITE_STORED - storedComposite;
+ }
+ }
+ public int UraniumToFill
+ {
+ get
+ {
+ return MAX_URANIUM_STORED - storedUranium;
+ }
+ }
+ public bool ShouldBeGlowingNow
+ {
+ get
+ {
+ return IsActive;
+ }
+ }
+
+ private Graphic activeGraphic;
+ private bool isActiveInt = true;
+ private int frameNumber;
+ private long tickCount;
+ private int outputSide = 2;
+ private int storedComposite;
+ private int storedGold;
+ private int storedUranium;
+ private bool hasError;
+ private string errorThingKey;
+ private byte reasonNotRunning;
+ private int ticksUntilOutput = -1;
+ private int powerMode;
+
+ public override void ExposeData()
+ {
+ base.ExposeData();
+ Scribe_Values.Look(ref isActiveInt, "isFusionActive");
+ Scribe_Values.Look(ref outputSide, "outputSide", 2);
+ Scribe_Values.Look(ref storedComposite, "storedComposite");
+ Scribe_Values.Look(ref storedGold, "storedGold");
+ Scribe_Values.Look(ref storedUranium, "storedUranium");
+ Scribe_Values.Look(ref ticksUntilOutput, "ticksUntilOutput", -1);
+ Scribe_Values.Look(ref powerMode, "powerMode");
+ }
+
+ public string RotToCardinalString(int rot)
+ {
+ switch (rot)
+ {
+ case 0:
+ return "AA.North".Translate();
+ case 1:
+ return "AA.East".Translate();
+ case 2:
+ return "AA.South".Translate();
+ case 3:
+ return "AA.West".Translate();
+ default:
+ return $"Unknown rotation: {rot}";
+ }
+ }
+
+ public override void Tick()
+ {
+ base.Tick();
+
+ tickCount++;
+
+ // Change power draw based on active status.
+ UpdatePowerDraw();
+
+ // Update active/running state.
+ bool oldActive = this.IsActive;
+ UpdateActiveState();
+ if (oldActive != this.IsActive)
+ {
+ CompGlower?.ReceiveCompSignal("PowerTurnedOn"); // Obviously the power hasn't actually just been turned on, but it's just a way to trigger UpdateLit to be called.
+ }
+
+ // Pull resources as long as there is power.
+ UpdatePullResources();
+
+ if (!IsActive)
+ {
+ frameNumber = 0;
+ activeGraphic = base.DefaultGraphic;
+ hasError = false;
+ return;
+ }
+
+ // Update output.
+ UpdateOutput();
+
+ // Update active state visuals.
+ UpdateActiveGraphics();
+ }
+
+ private void UpdatePowerDraw()
+ {
+ PowerTraderComp.PowerOutput = this.IsActive ? -GetActivePowerDraw() : PowerTraderComp.Props.basePowerConsumption;
+ }
+
+ public float GetActivePowerDraw()
+ {
+ switch (powerMode)
+ {
+ case 0:
+ return POWER_DRAW_NORMAL;
+ case 1:
+ return POWER_DRAW_OVERCLOCKED;
+ case 2:
+ return POWER_DRAW_INSANITY;
+ default:
+ return POWER_DRAW_NORMAL;
+ }
+ }
+
+ ///
+ /// Gets the speed multiplier based on current power mode.
+ ///
+ public int GetActiveSpeed()
+ {
+ switch (powerMode)
+ {
+ case 0:
+ return 1;
+ case 1:
+ return 2;
+ case 2:
+ return 4;
+ default:
+ return 1;
+ }
+ }
+
+ private void UpdatePullResources()
+ {
+ if (tickCount % PULL_INTERVAL == 0 && PowerTraderComp.PowerOn)
+ {
+ hasError = false;
+ storedUranium += TryPullFromAll("Uranium", UraniumToFill, out bool err);
+ if (err)
+ {
+ hasError = true;
+ errorThingKey = "AA.Uranium";
+ }
+ storedGold += TryPullFromAll("Gold", GoldToFill, out err);
+ if (err)
+ {
+ hasError = true;
+ errorThingKey = "AA.Gold";
+ }
+ storedComposite += TryPullFromAll("AntimatterComposite_AA", CompositeToFill, out err);
+ if (err)
+ {
+ hasError = true;
+ errorThingKey = "AA.AntimatterComposite";
+ }
+ }
+ }
+
+ private void UpdateActiveState()
+ {
+ IsActive = true; // Assume running for now.
+ reasonNotRunning = 0;
+ if (!PowerTraderComp.PowerOn)
+ {
+ reasonNotRunning = 1;
+ IsActive = false;
+ }
+ else if (storedGold < GOLD_PER_HYPER || storedComposite < COMPOSITE_PER_HYPER || storedUranium < URANIUM_PER_HYPER)
+ {
+ reasonNotRunning = 2;
+ IsActive = false;
+ }
+ }
+
+ private void UpdateOutput()
+ {
+ if (ticksUntilOutput < 0)
+ {
+ ticksUntilOutput = TICKS_PER_HYPER / GetActiveSpeed();
+ }
+ if (ticksUntilOutput > 0)
+ {
+ ticksUntilOutput--;
+ if (ticksUntilOutput == 0)
+ {
+ // Give output.
+ PlaceOutput(1);
+
+ // Remove internal resources.
+ storedComposite -= COMPOSITE_PER_HYPER;
+ storedGold -= GOLD_PER_HYPER;
+ storedUranium -= URANIUM_PER_HYPER;
+
+ // Flag timer to be reset.
+ ticksUntilOutput = -1;
+ }
+ }
+ }
+
+ private void UpdateActiveGraphics()
+ {
+ if (activeGraphics == null)
+ {
+ LoadGraphics(this);
+ }
+
+ activeGraphic = activeGraphics[frameNumber];
+ if (tickCount % TICKS_PER_FRAME == 0)
+ {
+ frameNumber++;
+ if (frameNumber >= FRAME_COUNT)
+ frameNumber = 0;
+ }
+ }
+
+ public int TryPullFromAll(string defName, int count, out bool hasInOutputSpot)
+ {
+ if (string.IsNullOrEmpty(defName))
+ throw new ArgumentNullException(nameof(defName));
+
+ hasInOutputSpot = false;
+ if (count <= 0)
+ {
+ return 0;
+ }
+
+ int remaining = count;
+ for (int i = 0; i < 4; i++)
+ {
+ var tray = GetTray(GetSpotOffset(i));
+ if (tray == null)
+ continue;
+
+ if (i == outputSide)
+ {
+ // Give player a warning if there is an input item in the output slot.
+ if(TrayHasItem(tray, defName, 0))
+ {
+ hasInOutputSpot = true;
+ }
+ // Don't pull from output side tray.
+ continue;
+ }
+
+ int pulled = TryPullFromTray(tray, defName, remaining);
+ remaining -= pulled;
+ if (remaining <= 0)
+ break;
+ }
+
+ int totalGot = count - remaining;
+ return totalGot;
+ }
+
+ public void PlaceOutput(int count)
+ {
+ if (count <= 0)
+ return;
+
+ Thing thing = ThingMaker.MakeThing(AADefOf.HyperAlloy_AA);
+ thing.stackCount = count;
+
+ GenPlace.TryPlaceThing(thing, this.Position + GetSpotOffset(outputSide), Find.CurrentMap, ThingPlaceMode.Near);
+ }
+
+ public IntVec3 GetSpotOffset(int rot)
+ {
+ switch (rot)
+ {
+ case 0:
+ return IntVec3.North * 2;
+ case 1:
+ return IntVec3.East * 2;
+ case 2:
+ return IntVec3.South * 2;
+ case 3:
+ return IntVec3.West * 2;
+ default:
+ return IntVec3.Zero;
+ }
+ }
+
+ public override string GetInspectString()
+ {
+ string cardRot = RotToCardinalString(outputSide).CapitalizeFirst();
+ string runningStatus;
+
+ if (IsActive)
+ {
+ runningStatus = "AA.AFMRunning".Translate((ticksUntilOutput / 2500f).ToString("F2"));
+ }
+ else
+ {
+ switch (reasonNotRunning)
+ {
+ case 1:
+ runningStatus = "AA.AFMNotRunningNoPower".Translate();
+ break;
+ case 2:
+ runningStatus = "AA.AFMNotRunningMissingStuff".Translate(GOLD_PER_HYPER, COMPOSITE_PER_HYPER, URANIUM_PER_HYPER);
+ break;
+ default:
+ runningStatus = "Not Running: Reason unknown.";
+ break;
+ }
+ }
+
+ return base.GetInspectString() + $"\n{runningStatus}\n{"AA.AFMStoredAmount".Translate(storedGold, MAX_GOLD_STORED, storedComposite, MAX_COMPOSITE_STORED, storedUranium, MAX_URANIUM_STORED)}{(hasError ? $"\n{"AA.AFMSlotError".Translate(errorThingKey.Translate().CapitalizeFirst(), cardRot)}" : "")}\n{"AA.AFMOutputSide".Translate(cardRot)}";
+ }
+
+ public override IEnumerable GetGizmos()
+ {
+ foreach (var gizmo in base.GetGizmos())
+ yield return gizmo;
+
+ var cmd = new Command_Action();
+ cmd.defaultLabel = "AA.AFMChangeOutputSide".Translate();
+ cmd.defaultDesc = "AA.AFMChangeOutputSideDesc".Translate();
+ cmd.icon = Content.ArrowIcon;
+ cmd.iconAngle = outputSide * 90f;
+ cmd.action = () =>
+ {
+ outputSide++;
+ if (outputSide >= 4)
+ outputSide = 0;
+ };
+
+ yield return cmd;
+
+ var cmd2 = new Command_Action();
+ cmd2.defaultLabel = "AA.AFMPowerLevel".Translate();
+ cmd2.defaultDesc = "AA.AFMPowerLevelDesc".Translate(GetActiveSpeed() * 100, GetActivePowerDraw());
+ cmd2.icon = powerMode == 2 ? Content.PowerLevelHigh : powerMode == 1 ? Content.PowerLevelMedium : Content.PowerLevelLow;
+ cmd2.action = () =>
+ {
+ powerMode++;
+ if (powerMode >= 3)
+ powerMode = 0;
+ };
+
+ yield return cmd2;
+ }
+ }
+}
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_AntimatterReactor.cs b/Source/AntimatterAnnihilation/Buildings/Building_AntimatterReactor.cs
index acc9380..7f953ff 100644
--- a/Source/AntimatterAnnihilation/Buildings/Building_AntimatterReactor.cs
+++ b/Source/AntimatterAnnihilation/Buildings/Building_AntimatterReactor.cs
@@ -68,9 +68,9 @@ public bool IsHorizontal
public float BuildingDamage = 25;
public float PawnDamage = 6.5f;
public int UpdateInterval = 20; // Every 20 ticks, so 3 times a second.
+ public Building_ReactorInjector CurrentInjector { get; private set; }
private List<(IntVec3 cell, byte weight)> avoidance = new List<(IntVec3 cell, byte weight)>();
- private Building_ReactorInjector currentInjector;
private int injectorRot;
private int tickCounter;
private long updateTick;
@@ -138,7 +138,7 @@ public void OnPowerStart(Map map = null)
public void OnPowerStop(Map map = null)
{
- Log.Message("Power stopped...");
+ //Log.Message("Power stopped...");
CauseRedraw(map);
}
@@ -155,13 +155,13 @@ public void RegisterInput(Building_ReactorInjector injector, int injRot)
// Assumes that the injector is valid (correct side, aligned properly).
tickCounter = 0;
- if (currentInjector != null && currentInjector != injector)
+ if (CurrentInjector != null && CurrentInjector != injector)
{
// Two injectors?!
// TODO handle (explode?)
}
- currentInjector = injector;
+ CurrentInjector = injector;
this.injectorRot = injRot;
tickCounter = 0;
if (!IsRunning)
@@ -173,10 +173,10 @@ public void RegisterInput(Building_ReactorInjector injector, int injRot)
public void RemoveInput(Building_ReactorInjector injector)
{
- if (currentInjector != injector)
+ if (CurrentInjector != injector)
return;
- currentInjector = null;
+ CurrentInjector = null;
if (IsRunning)
{
@@ -189,14 +189,14 @@ public override void Tick()
{
base.Tick();
- if(tickCounter < TicksToShutdownWithNoInput && currentInjector != null)
+ if(tickCounter < TicksToShutdownWithNoInput && CurrentInjector != null)
tickCounter++;
- if (tickCounter == TicksToShutdownWithNoInput)
+ if (tickCounter >= TicksToShutdownWithNoInput)
{
if (IsRunning)
{
IsRunning = false;
- currentInjector = null;
+ CurrentInjector = null;
CauseRedraw();
}
}
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_CompositeRefiner.cs b/Source/AntimatterAnnihilation/Buildings/Building_CompositeRefiner.cs
index 6dff770..241baa3 100644
--- a/Source/AntimatterAnnihilation/Buildings/Building_CompositeRefiner.cs
+++ b/Source/AntimatterAnnihilation/Buildings/Building_CompositeRefiner.cs
@@ -4,8 +4,16 @@
namespace AntimatterAnnihilation.Buildings
{
- public class Building_CompositeRefiner : Building_Storage
+ public class Building_CompositeRefiner : Building_TrayPuller, IConditionalGlower
{
+ public bool ShouldBeGlowingNow
+ {
+ get
+ {
+ return GetShouldBeRunning();
+ }
+ }
+
public CompPowerTrader PowerTraderComp
{
get
@@ -16,6 +24,16 @@ public CompPowerTrader PowerTraderComp
}
}
private CompPowerTrader _powerTraderComp;
+ public CompGlower CompGlower
+ {
+ get
+ {
+ if (_compGlower == null)
+ this._compGlower = base.GetComp();
+ return _compGlower;
+ }
+ }
+ private CompGlower _compGlower;
public IntVec3 OutputPos
{
get
@@ -50,6 +68,7 @@ public int MissingAntimatter
public int ProductionTicks;
private ulong tickCount;
+ private bool lastFrameRunning;
public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
@@ -91,7 +110,13 @@ public override void Tick()
}
}
- if (tickCount % 120 == 0)
+ if (lastFrameRunning != isRunning)
+ {
+ CompGlower?.ReceiveCompSignal("PowerTurnedOn"); // Obviously the power hasn't actually just been turned on, but it's just a way to trigger UpdateLit to be called.
+ }
+ lastFrameRunning = isRunning;
+
+ if (tickCount % 120 == 0 && PowerTraderComp.PowerOn)
{
Building_InputTray lt = null;
Building_InputTray rt = null;
@@ -100,8 +125,8 @@ public override void Tick()
lt = GetLeftTray();
rt = GetRightTray();
- TryGet(rt, "Plasteel", MissingPlasteel, ref CurrentPlasteelCount);
- TryGet(lt, "Plasteel", MissingPlasteel, ref CurrentPlasteelCount);
+ CurrentPlasteelCount += TryPullFromTray(rt, "Plasteel", MissingPlasteel);
+ CurrentPlasteelCount += TryPullFromTray(lt, "Plasteel", MissingPlasteel);
}
if (MissingAntimatter != 0)
@@ -112,8 +137,8 @@ public override void Tick()
rt = GetRightTray();
}
- TryGet(lt, "AntimatterCanister_AA", MissingAntimatter, ref CurrentAntimatterCount);
- TryGet(rt, "AntimatterCanister_AA", MissingAntimatter, ref CurrentAntimatterCount);
+ CurrentAntimatterCount += TryPullFromTray(lt, "AntimatterCanister_AA", MissingAntimatter);
+ CurrentAntimatterCount += TryPullFromTray(rt, "AntimatterCanister_AA", MissingAntimatter);
}
}
}
@@ -129,22 +154,6 @@ public void PlaceOutput(int count)
GenPlace.TryPlaceThing(thing, OutputPos, Find.CurrentMap, ThingPlaceMode.Near);
}
- public void TryGet(Building_InputTray tray, string defName, int amount, ref int counter)
- {
- if (amount <= 0)
- return;
- if (tray == null)
- return;
- if (defName == null)
- return;
-
- var removed = tray.TryRemove(defName, amount);
- if (removed > 0)
- {
- counter += removed;
- }
- }
-
public override void ExposeData()
{
base.ExposeData();
@@ -164,13 +173,6 @@ public Building_InputTray GetRightTray()
return GetTray(new IntVec3(2, 0, 0));
}
- public Building_InputTray GetTray(IntVec3 offset)
- {
- var thing = Map?.thingGrid.ThingAt(base.Position + offset, ThingCategory.Building);
-
- return thing as Building_InputTray;
- }
-
public bool GetShouldBeRunning()
{
return GetReasonNotRunning() == null;
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_InputTray.cs b/Source/AntimatterAnnihilation/Buildings/Building_InputTray.cs
index a29286c..d12d5a6 100644
--- a/Source/AntimatterAnnihilation/Buildings/Building_InputTray.cs
+++ b/Source/AntimatterAnnihilation/Buildings/Building_InputTray.cs
@@ -2,6 +2,7 @@
using RimWorld;
using System.Collections.Generic;
using Verse;
+using AntimatterAnnihilation.Utils;
namespace AntimatterAnnihilation.Buildings
{
@@ -9,7 +10,23 @@ public class Building_InputTray : Building_Storage
{
private static List bin = new List();
- public int TryRemove(string thingDefName, int count)
+ public bool HasItem(string thingDefName, int minCount)
+ {
+ if (thingDefName == null)
+ return false;
+
+ foreach (var thing in base.slotGroup.HeldThings)
+ {
+ if (thing.def.defName == thingDefName && !thing.Destroyed)
+ {
+ if (thing.stackCount >= minCount)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int TryPull(string thingDefName, int count)
{
if (count <= 0)
return 0;
@@ -56,5 +73,61 @@ public int TryRemove(string thingDefName, int count)
return amountRemoved;
}
+
+ public override void SpawnSetup(Map map, bool respawningAfterLoad)
+ {
+ base.SpawnSetup(map, respawningAfterLoad);
+
+ var s = GetStoreSettings();
+ s.filter.allowedHitPointsConfigurable = false;
+ s.filter.allowedQualitiesConfigurable = false;
+ }
+
+ public override IEnumerable GetGizmos()
+ {
+ foreach (var g in base.GetGizmos())
+ yield return g;
+
+ // For composite refiner
+ yield return GizmoFor(AADefOf.Plasteel);
+ yield return GizmoFor(AADefOf.AntimatterCanister_AA);
+
+ // For alloy machine.
+ yield return GizmoFor(AADefOf.AntimatterComposite_AA);
+ yield return GizmoFor(AADefOf.Gold);
+ yield return GizmoFor(AADefOf.Uranium);
+ yield return GizmoFor(AADefOf.HyperAlloy_AA, StoragePriority.Low);
+ }
+
+ private Command_Action GizmoFor(ThingDef item, StoragePriority p = StoragePriority.Important)
+ {
+ var cmd = new Command_Action();
+ cmd.icon = item.uiIcon;
+ cmd.defaultLabel = "AA.SetTrayFor".Translate(item.LabelCap);
+ cmd.defaultDesc = "AA.SetTrayForDesc".Translate(item.LabelCap);
+ cmd.action = () =>
+ {
+ SetSettingsTo(item, p);
+ };
+
+ return cmd;
+ }
+
+ public void SetSettingsTo(ThingDef item, StoragePriority p = StoragePriority.Important)
+ {
+ var s = this.GetStoreSettings();
+ s.filter.SetDisallowAll();
+ s.filter.SetAllow(item, true);
+ s.Priority = p;
+ }
+
+ public override string GetInspectString()
+ {
+ var s = GetStoreSettings();
+ int count = s.filter.AllowedDefCount;
+
+ string stored = count == 0 ? (string)"AA.TrayStoredNothing".Translate() : count == 1 ? s.filter.Summary.CapitalizeFirst() : (string)"AA.TrayStoredMultiple".Translate();
+ return "AA.TrayCurrentlyStored".Translate(stored);
+ }
}
}
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_MBD.cs b/Source/AntimatterAnnihilation/Buildings/Building_MBD.cs
new file mode 100644
index 0000000..70473b1
--- /dev/null
+++ b/Source/AntimatterAnnihilation/Buildings/Building_MBD.cs
@@ -0,0 +1,15 @@
+namespace AntimatterAnnihilation.Buildings
+{
+ public class Building_MBD : Building_AATurret
+ {
+ public Building_MBD()
+ {
+ this.ScreenShakeOnShoot = 0.03f;
+ }
+
+ public override AATurretTop CreateTop()
+ {
+ return new MBDTop(this);
+ }
+ }
+}
diff --git a/Source/AntimatterAnnihilation/Buildings/Building_Megumin.cs b/Source/AntimatterAnnihilation/Buildings/Building_Megumin.cs
index ab5bfc9..9758227 100644
--- a/Source/AntimatterAnnihilation/Buildings/Building_Megumin.cs
+++ b/Source/AntimatterAnnihilation/Buildings/Building_Megumin.cs
@@ -9,10 +9,11 @@
using UnityEngine;
using Verse;
using Verse.Sound;
+using Object = UnityEngine.Object;
namespace AntimatterAnnihilation.Buildings
{
- public class Building_Megumin : Building
+ public class Building_Megumin : Building, IConditionalGlower
{
[TweakValue("AntimatterAnnihilation")]
public static bool DoSolarFlare = true;
@@ -28,6 +29,13 @@ public class Building_Megumin : Building
public static float EXPLOSION_PEN = 0.7f;
public static float CHARGE_WATT_DAYS = 600 * 5; // Requires 5 fully-powered batteries to charge (semi-instantly). Otherwise it will take longer depending on power production.
+ public bool ShouldBeGlowingNow
+ {
+ get
+ {
+ return IsPoweringUp;
+ }
+ }
public CompEquippable GunComp
{
get
@@ -58,6 +66,16 @@ public CompRefuelableConditional FuelComp
}
}
private CompRefuelableConditional _compRefuelable;
+ public CompGlower CompGlower
+ {
+ get
+ {
+ if (_compGlower == null)
+ this._compGlower = base.GetComp();
+ return _compGlower;
+ }
+ }
+ private CompGlower _compGlower;
public Verb AttackVerb
{
get
@@ -93,10 +111,12 @@ protected set
public int CooldownTicks;
public int PoweringUpTicks;
+ private IntVec3 lastKnownThingLoc; // Used to prevent bugs where target is destroyed and laser does not spawn.
private bool isChargingUp;
private UpBeam beam;
private LocalTargetInfo localTarget;
private Sustainer soundSustainer;
+ private ParticleSystem chargeEffect;
public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
@@ -112,6 +132,16 @@ public override void SpawnSetup(Map map, bool respawningAfterLoad)
beam = new UpBeam(map, this.TrueCenter() + new Vector3(0f, 0f, 1.2f));
beam.IsActive = false;
}
+
+ if(chargeEffect == null)
+ {
+ chargeEffect = Object.Instantiate(Content.MeguminChargePrefab).GetComponent();
+ chargeEffect.transform.position = this.TrueCenter() + new Vector3(0f, 0f, 1.1f);
+ chargeEffect.transform.eulerAngles = new Vector3(90f, 0f, 0f);
+ }
+
+ if (!IsPoweringUp)
+ chargeEffect.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}
public override IEnumerable GetGizmos()
@@ -191,8 +221,15 @@ public override void DeSpawn(DestroyMode mode = DestroyMode.Vanish)
private void StartAttackSequence(LocalTargetInfo target)
{
+ if (!target.IsValid)
+ {
+ Log.Error($"Tried to start M3G_UMIN attack with invalid target {target}.");
+ return;
+ }
+
// Set local target.
this.localTarget = target;
+ lastKnownThingLoc = target.Cell;
// Enter the charging phase.
IsChargingUp = true;
@@ -209,18 +246,33 @@ private void StartPowerUpSequence()
// Play the long attack sound.
SoundInfo info = SoundInfo.InMap(this, MaintenanceType.PerTick);
soundSustainer = AADefOf.LaserStrike_AA.TrySpawnSustainer(info);
+
+ // Do particle effects.
+ chargeEffect?.Play(true);
+
+ // Enable glow start.
+ CompGlower?.ReceiveCompSignal("PowerTurnedOn");
}
private void StartRealAttack()
{
+ // Make sure that the local target is completely valid: it is possible that thing is destroyed and Target.IsValid is still true.
+ if (localTarget.HasThing && localTarget.ThingDestroyed)
+ {
+ Log.Warning($"M3G_UMIN appears to have been targeting a Thing but that Thing was destroyed. Using last known location: {lastKnownThingLoc}");
+ localTarget = new LocalTargetInfo(lastKnownThingLoc);
+ }
// Spawn sky beam of death.
AttackVerb.TryStartCastOn(localTarget);
+ chargeEffect?.Stop(true, ParticleSystemStopBehavior.StopEmitting);
+
// Put on cooldown.
CooldownTicks = COOLDOWN_TICKS;
// Delete target position.
localTarget = null;
+ lastKnownThingLoc = IntVec3.Zero;
// Spawn a solar flare event on the map that it was fired from.
if (DoSolarFlare)
@@ -231,11 +283,11 @@ private void StartRealAttack()
bool canFire = AADefOf.SolarFlare.Worker.CanFireNow(param);
if (!canFire)
- Log.Warning($"SolarFare Worker says that it cannot fire under the current conditions - forcing it to anyway, from M3G_UMIN.");
+ Log.Warning("SolarFare Worker says that it cannot fire under the current conditions - forcing it to anyway, from M3G_UMIN.");
bool worked = AADefOf.SolarFlare.Worker.TryExecute(param);
if (!worked)
- Log.Error($"SolarFare Worker failed to execute (returned false), from M3G_UMIN.");
+ Log.Error("SolarFare Worker failed to execute (returned false), from M3G_UMIN.");
}
}
@@ -248,10 +300,16 @@ private void StopFireLaser()
{
beam.IsActive = false;
soundSustainer?.End();
+
+ // Turn off glow.
+ CompGlower?.ReceiveCompSignal("PowerTurnedOn");
}
private void DoEasterEgg()
{
+ if (!Settings.EnableEasterEggs)
+ return;
+
// It's a trash anime btw. Genuine waste of time.
// You're better off watching JoJo or Cowboy Bebob or KillLaKill.
AADefOf.Explosion_Voice_AA.PlayOneShotOnCamera();
@@ -294,6 +352,7 @@ public override void ExposeData()
Scribe_Values.Look(ref CooldownTicks, "cooldownTicks");
Scribe_Values.Look(ref PoweringUpTicks, "powerUpTicks");
Scribe_Values.Look(ref isChargingUp, "isChargingUp");
+ Scribe_Values.Look(ref lastKnownThingLoc, "lastKnownThingLoc");
Scribe_Deep.Look(ref gun, "gun", Array.Empty