NotQuiteParadise2

Unit

class Unit(game: Game, id_: int, unit_type: str, team: str, pos: pygame.Vector2)[source]

Bases: object

__init__(game: Game, id_: int, unit_type: str, team: str, pos: pygame.Vector2)[source]
add_modifier(stat: str, amount: int)[source]

Add a modifier to a stat. Stub

delete_entities(immediately: bool = False)[source]

Delete all entities. If “immediately” = False this will happen on the next frame.

draw_banner(surface: pygame.Surface, shift: pygame.math.Vector2 = (0, 0))[source]

Draw’s the Unit’s banner.

draw_border(surface: pygame.Surface, shift: pygame.math.Vector2 = (0, 0))[source]

Draw the border around the unit.

generate_border_surface()[source]

Generate a new border around the Unit. Stub

get_modified_status(stat: str) nqp.core.constants.StatModifiedStatus[source]

Check if a given stat is modified. Stub.

property is_alive
reset_for_combat()[source]

Reset the in combat values ready to begin combat.

set_position(pos: pygame.math.Vector2)[source]

Set the unit’s position and moves the Entities to match.

spawn_entities()[source]

Spawn the Unit’s Entities. Deletes any existing Entities first.

update(delta_time: float)[source]
update_position()[source]

Update unit position by averaging the positions of all its entities.