Moved 'building' entity definitions into 'structures', renamed building component to structure, moved svgs the same.

This commit is contained in:
2021-01-15 11:05:57 -06:00
parent 36f79c6f57
commit e30d73d4d7
19 changed files with 29 additions and 29 deletions

View File

@@ -6,9 +6,9 @@ tiles = [
[false, :path, :path, :path, false],
]
IMICRTS::Entity.define_entity(:barracks, :building, 400, 40, "Builds and heals soldiers", tiles) do |entity|
IMICRTS::Entity.define_entity(:barracks, :structure, 400, 40, "Builds and heals soldiers", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
entity.has(:waypoint)
entity.has(:spawner)
entity.has(:build_queue)

View File

@@ -6,9 +6,9 @@ tiles = [
[false, :path, :path, :path, false],
]
IMICRTS::Entity.define_entity(:construction_yard, :building, 2_000, 310, "Provides radar and builds construction workers", tiles) do |entity|
IMICRTS::Entity.define_entity(:construction_yard, :structure, 2_000, 310, "Provides radar and builds construction workers", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
entity.has(:waypoint)
entity.has(:spawner)
entity.has(:build_queue)
@@ -48,7 +48,7 @@ IMICRTS::Entity.define_entity(:construction_yard, :building, 2_000, 310, "Provid
entity.on_tick do
if entity.component(:building).construction_complete?
if entity.component(:structure).construction_complete?
item = entity.component(:build_queue).queue.first
entity.particle_emitters.each_with_index do |emitter, i|

View File

@@ -6,9 +6,9 @@ tiles = [
[false, false, false, false, false],
]
IMICRTS::Entity.define_entity(:helipad, :building, 1_000, 100, "Builds and rearms aircraft", tiles) do |entity|
IMICRTS::Entity.define_entity(:helipad, :structure, 1_000, 100, "Builds and rearms aircraft", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
entity.has(:waypoint)
entity.has(:spawner)
entity.has(:build_queue)

View File

@@ -6,9 +6,9 @@ tiles = [
[false, false, :path, false, false],
]
IMICRTS::Entity.define_entity(:power_plant, :building, 800, 45, "Generates power", tiles) do |entity|
IMICRTS::Entity.define_entity(:power_plant, :structure, 800, 45, "Generates power", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
end
entity.radius = 24
@@ -37,7 +37,7 @@ IMICRTS::Entity.define_entity(:power_plant, :building, 800, 45, "Generates power
entity.on_tick do
# entity.produce_power
if entity.component(:building).construction_complete?
if entity.component(:structure).construction_complete?
entity.particle_emitters.each do |emitter|
emitter.emitting = true
end

View File

@@ -6,9 +6,9 @@ tiles = [
[false, false, :path, :path, false],
]
IMICRTS::Entity.define_entity(:refinery, :building, 1_400, 200, "Generates credits", tiles) do |entity|
IMICRTS::Entity.define_entity(:refinery, :structure, 1_400, 200, "Generates credits", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
end
entity.radius = 44
@@ -28,7 +28,7 @@ IMICRTS::Entity.define_entity(:refinery, :building, 1_400, 200, "Generates credi
entity.particle_emitters << IMICRTS::SmokeEmitter.new(position: p1, emitting: false)
entity.on_tick do
if entity.component(:building).data.state == :idle
if entity.component(:structure).data.state == :idle
entity.particle_emitters.each do |emitter|
emitter.emitting = true

View File

@@ -6,9 +6,9 @@ tiles = [
[false, :path, :path, :path, false],
]
IMICRTS::Entity.define_entity(:war_factory, :building, 2_000, 310, "Builds and repairs ground vehicles", tiles) do |entity|
IMICRTS::Entity.define_entity(:war_factory, :structure, 2_000, 310, "Builds and repairs ground vehicles", tiles) do |entity|
unless entity.proto_entity
entity.has(:building)
entity.has(:structure)
entity.has(:waypoint)
entity.has(:spawner)
entity.has(:build_queue)
@@ -37,7 +37,7 @@ IMICRTS::Entity.define_entity(:war_factory, :building, 2_000, 310, "Builds and r
entity.particle_emitters << IMICRTS::SmokeEmitter.new(position: p2, emitting: false)
entity.on_tick do
if entity.component(:building).construction_complete?
if entity.component(:structure).construction_complete?
item = entity.component(:build_queue).queue.first
entity.particle_emitters.each do |pe|