Ejemplo n.º 1
0
    def action(current_ticks):
        entity.remove_pending_action(action)

        entity_pt = entity.get_position()
        smith = worldmodel.find_nearest(world, entity_pt, entities.Blacksmith)
        (tiles, found) = miner_to_smith(world, entity, smith)

        new_entity = entity
        if found:
            new_entity = try_transform_miner(world, entity,
                                             try_transform_miner_full)

        schedule_action(world, new_entity,
                        create_miner_action(world, new_entity, i_store),
                        current_ticks + new_entity.get_rate())
        return tiles
Ejemplo n.º 2
0
   def action(current_ticks):
      entity.remove_pending_action(action)

      entity_pt = entity.get_position()
      smith = worldmodel.find_nearest(world, entity_pt, entities.Blacksmith)
      (tiles, found) = miner_to_smith(world, entity, smith)

      new_entity = entity
      if found:
         new_entity = try_transform_miner(world, entity,
            try_transform_miner_full)

      schedule_action(world, new_entity,
         create_miner_action(world, new_entity, i_store),
         current_ticks + new_entity.get_rate())
      return tiles
Ejemplo n.º 3
0
   def action(current_ticks):
      entities.remove_pending_action(entity, action)

      entity_pt = entities.get_position(entity)
      ore = worldmodel.find_nearest(world, entity_pt, entities.Ore)
      (tiles, found) = miner_to_ore(world, entity, ore)

      new_entity = entity
      if found:
         new_entity = try_transform_miner(world, entity,
            try_transform_miner_not_full)

      schedule_action(world, new_entity,
         create_miner_action(world, new_entity, i_store),
         current_ticks + entities.get_rate(new_entity))
      return tiles
Ejemplo n.º 4
0
    def action(current_ticks):
        entities.remove_pending_action(entity, action)

        entity_pt = entities.get_position(entity)
        ore = worldmodel.find_nearest(world, entity_pt, entities.Ore)
        (tiles, found) = miner_to_ore(world, entity, ore)

        new_entity = entity
        if found:
            new_entity = try_transform_miner(world, entity,
                                             try_transform_miner_not_full)

        schedule_action(world, new_entity,
                        create_miner_action(world, new_entity, i_store),
                        current_ticks + entities.get_rate(new_entity))
        return tiles
Ejemplo n.º 5
0
    def action(current_ticks):
        entity.remove_pending_action(action)

        entity_pt = entity.get_position()
        vein = worldmodel.find_nearest(world, entity_pt, entities.Vein)
        (tiles, found) = blob_to_vein(world, entity, vein)

        next_time = current_ticks + entity.get_rate()
        if found:
            quake = create_quake(world, tiles[0], current_ticks, i_store)
            worldmodel.add_entity(world, quake)
            next_time = current_ticks + entity.get_rate() * 2

        schedule_action(world, entity,
                        create_ore_blob_action(world, entity, i_store),
                        next_time)

        return tiles
Ejemplo n.º 6
0
   def action(current_ticks):
      entity.remove_pending_action(action)

      entity_pt = entity.get_position()
      vein = worldmodel.find_nearest(world, entity_pt, entities.Vein)
      (tiles, found) = blob_to_vein(world, entity, vein)

      next_time = current_ticks + entity.get_rate()
      if found:
         quake = create_quake(world, tiles[0], current_ticks, i_store)
         worldmodel.add_entity(world, quake)
         next_time = current_ticks + entity.get_rate() * 2

      schedule_action(world, entity,
         create_ore_blob_action(world, entity, i_store),
         next_time)

      return tiles