Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sarah Oran
ants_vs_some_bees
Commits
e15ec0bf
Commit
e15ec0bf
authored
Mar 19, 2020
by
nschroeder1771
Browse files
Added a doctest to the super harvesterand changed the values of the start of the game.
parent
f281013b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ants_vs_some_bees.py
View file @
e15ec0bf
...
...
@@ -297,7 +297,14 @@ class SuperHarvester(Harvester):
def
act
(
self
,
game_state
):
"""
A Super Harvest produces more food than a Harvest for the colony.
A Super Harvester produces two food for the colony per turn.
>>> ant_place = ColonyPlace(0,0)
>>> state = GameState(places=[ant_place], queen_place=None, ant_archetypes=[], food=0)
>>> ant = SuperHarvester(unit_type=None, food_cost=0, health=5, production=2)
>>> ant_place.add_insect(ant)
>>> ant.act(state)
>>> state.food
2
"""
super
().
act
(
game_state
)
...
...
@@ -305,6 +312,13 @@ class SuperHarvester(Harvester):
"""
In order for a super harvester to live it must have a leaf thrower next to it.
"""
place
=
self
.
place
left_place
=
self
.
left_place
right_place
=
self
.
right_place
top_place
=
self
.
top_place
bottom_place
=
self
.
bottom_place
# Need help on how to do this, I can't seem to figure it out
class
Thrower
(
Ant
):
...
...
@@ -485,8 +499,8 @@ class Thrower(Ant):
>>> ant_place = ColonyPlace(1, 0)
>>> bee1_place = ColonyPlace(0, 0)
>>> bee2_place = ColonyPlace(6, 7)
>>> ant_place.connect_to(bee_place)
>>> state = GameState(places=[ant_place, bee_place], queen_place=None, ant_archetypes=[], food=0)
>>> ant_place.connect_to(bee
1
_place)
>>> state = GameState(places=[ant_place, bee
1_place, bee2
_place], queen_place=None, ant_archetypes=[], food=0)
>>> ant = Thrower(unit_type=None, food_cost=0, health=5, damage=1, ammo= 4, minimum_range=0, maximum_range=2)
>>> ant_place.add_insect(ant)
>>> bee1 = Bee(health=4, damage=1, delay=0)
...
...
@@ -573,6 +587,8 @@ class WallAnt(Ant):
The wall ant must be next to another ant in order to survive.
"""
# Same situation as the Super Harvester, need help on how to do this.
class
GameOutcome
(
Enum
):
"""
...
...
@@ -687,8 +703,8 @@ STANDARD_ANT_ARCHETYPES = (
)
def
make_standard_game
(
radius
=
4
,
wave_count
=
4
,
wave_size
=
2
,
wave_growth
=
1
,
wave_interval
=
5
,
bee_health
=
4
,
bee_damage
=
1
,
ant_archetypes
=
STANDARD_ANT_ARCHETYPES
,
food
=
1
5
):
def
make_standard_game
(
radius
=
4
,
wave_count
=
4
,
wave_size
=
3
,
wave_growth
=
1
,
wave_interval
=
5
,
bee_health
=
4
,
bee_damage
=
1
,
ant_archetypes
=
STANDARD_ANT_ARCHETYPES
,
food
=
1
2
):
"""
Construct the GameState for the beginning of a standard game, which has the ant queen in the center of a square of
ColonyPlaces, the Bee's hive on the periphery, and Bee's attacking in waves of increasing size. Most of the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment