protected Structure(Team team, iTile tile_, float radius = 100.0f) : base(tile_.get_structure_base() + new Vector3(0, 250, 0), new Vector3(1, 1, 1) * radius) { owner = team; health = get_integrity(); Status = Structure_State_e.PRESENT_MODE; Connected_to_Team = true; tile_on = tile_; opened = false; default_position = center; default_size = new Vector3(1,1,1)*radius; default_radius = radius; create_body(); save_height = tile_on.get_height(); Present_Clock.Start(); }
public override void Update() { //Structures don't move, so their body doen't need to be changed. base.Update(); if(Status == Structure_State_e.DESTROYED) { perform_destruction_effects(); // tile_on.destroy_structure(); owner.remove_tile(tile_on); } if(Isolation_Clock.ElapsedMilliseconds > Globals.time_isolated) { Status = Structure_State_e.DESTROYED; // Game_Model::get().play_chainbreak(); // Sound } if (Present_Clock.ElapsedMilliseconds > Globals.time_as_present && !opened) { opened = true; Status = Structure_State_e.UNWRAP_MODE; } if (Status == Structure_State_e.UNWRAP_MODE) { /* EWWW switch(owner.get_Team_Index()) { case BLUE: { Game_Model::get().add_effect(new Effect("bluepresent_unwrapped", center, size, 50)); break; } case GREEN: { Game_Model::get().add_effect(new Effect("greenpresent_unwrapped", center, size, 50)); break; } case RED: { Game_Model::get().add_effect(new Effect("redpresent_unwrapped", center, size, 50)); break; } case ORANGE: { Game_Model::get().add_effect(new Effect("orangepresent_unwrapped", center, size, 50)); break; } default: Game_Model::get().add_effect(new Effect("bluepresent_unwrapped", center, size, 50)); break; } */ restore_default_size_and_position(); center.Z -= (save_height - tile_on.get_height()); } }
public void receive_hit(float damage) { health -= damage; if(health < 0) Status = Structure_State_e.DESTROYED; }