Added construction complete order, added jeep overlay image to show windscreen, added rotors component for helicopter; more work needed, replaced all build and vehicle assets with ones that are 6x larger to prevent pixelization when zoomed in, misc.

This commit is contained in:
2021-01-08 12:41:04 -06:00
parent 0d449b9375
commit a3c3939f50
45 changed files with 149 additions and 66 deletions

View File

@@ -3,6 +3,8 @@ class IMICRTS
def setup
data.construction_progress ||= 0
data.construction_goal ||= Entity.get(@parent.name).build_steps
data.construction_complete ||= false
data.construction_complete_ordered ||= false
@text = CyberarmEngine::Text.new("", y: @parent.position.y, z: Float::INFINITY, size: 12)
data.state = :construct # deconstruct, building, idle
@@ -32,7 +34,7 @@ class IMICRTS
end
def construction_complete?
data.construction_progress >= data.construction_goal
data.construction_progress >= data.construction_goal && data.construction_complete
end
# WARNING: returns a floating point number, not network safe!
@@ -44,7 +46,14 @@ class IMICRTS
raise TypeError, "Got a non integer value!" unless work.is_a?(Integer)
data.construction_progress += work
data.construction_progress = data.construction_goal if construction_complete?
return unless data.construction_progress > data.construction_goal
data.construction_progress = data.construction_goal
unless data.construction_complete_ordered
@parent.director.schedule_order(IMICRTS::Order::CONSTRUCTION_COMPLETE, @parent.player.id, @parent.id)
data.construction_complete_ordered = true
end
end
def draw_construction