-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGreep.ctxt
107 lines (107 loc) · 7.27 KB
/
Greep.ctxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#BlueJ class context
comment0.params=ship
comment0.target=Greep(Ship)
comment0.text=\r\n\ Create\ a\ greep.\r\n
comment1.params=
comment1.target=void\ act()
comment1.text=\r\n\ Greenfoot's\ standard\ act\ method,\ which\ can\ be\ reimplemented\ in\ subclasses.\r\n\ When\ reimplemented,\ the\ first\ line\ of\ the\ act()\ should\ always\ call\ super.act().\r\n
comment10.params=
comment10.target=boolean\ moveWasBlocked()
comment10.text=\r\n\ Return\ true\ if\ we\ have\ been\ blocked\ by\ an\ opponent\ greep.\r\n
comment11.params=
comment11.target=void\ loadTomato()
comment11.text=\r\n\ Load\ a\ tomato\ onto\ *another*\ greep.\ This\ works\ only\ if\ there\ is\ another\ greep\r\n\ and\ a\ tomato\ pile\ present,\ otherwise\ this\ method\ does\ nothing.\r\n
comment12.params=
comment12.target=boolean\ carryingTomato()
comment12.text=\r\n\ Check\ whether\ we\ are\ carrying\ a\ tomato.\r\n
comment13.params=
comment13.target=void\ dropTomato()
comment13.text=\r\n\ Drop\ the\ tomato\ we\ are\ carrying.\ If\ we\ are\ at\ the\ ship,\ it\ is\ counted.\r\n\ If\ not,\ it's\ just\ gone...\r\n
comment14.params=
comment14.target=TomatoPile\ getTomatoes()
comment14.text=\r\n\ If\ we\ can\ see\ tomatoes,\ this\ will\ return\ them.\ Otherwise\ it\ returnes\ null.\r\n\ <p>\r\n\ You\ are\ only\ allowed\ to\ call\ getX()\ and\ getY()\ on\ the\ returned\ tomato\ pile.\ \r\n
comment15.params=withTomatoes
comment15.target=int\ numberOfOpponents(boolean)
comment15.text=\r\n\ Return\ the\ number\ of\ nearby\ opponent\ greeps\ which\ are\ not\ currently\ knocked\ out\ by\ a\ stink\ bomb.\r\n\ \r\n\ @param\ withTomatoes\ If\ true,\ only\ count\ the\ greeps\ that\ are\ carrying\ a\ tomato.\r\n
comment16.params=withTomatoes
comment16.target=int\ numberOfFriends(boolean)
comment16.text=\r\n\ Return\ the\ number\ of\ nearby\ friendly\ greeps\ which\ are\ not\ currently\ knocked\ out\ by\ a\ stink\ bomb.\r\n\ \r\n\ @param\ withTomatoes\ If\ true,\ only\ count\ the\ greeps\ that\ are\ carrying\ a\ tomato.\r\n
comment17.params=
comment17.target=Greep\ getFriend()
comment17.text=\r\n\ Returns\ a\ friendly\ greep,\ if\ there\ is\ one\ at\ our\ current\ location.\r\n\ Returns\ null\ otherwise.\r\n\ <p>\r\n\ You\ are\ only\ allowed\ to\ access\ the\ memory\ and\ flags\ of\ the\ friend.\r\n
comment18.params=percent
comment18.target=boolean\ randomChance(int)
comment18.text=\r\n\ Return\ 'true'\ in\ exactly\ 'percent'\ number\ of\ calls.\ That\ is\:\ a\ call\r\n\ randomChance(25)\ has\ a\ 25%\ chance\ to\ return\ true.\r\n
comment19.params=slot\ val
comment19.target=void\ setMemory(int,\ int)
comment19.text=\r\n\ Store\ something\ in\ the\ greep's\ memory.\ There\ are\ four\ memory\ slots,\ numbered\r\n\ 0\ to\ 3,\ each\ can\ hold\ an\ int\ value.\r\n
comment2.params=
comment2.target=java.lang.String\ getName()
comment2.text=\r\n\ This\ method\ specifies\ the\ name\ of\ the\ greeps\ (for\ display\ on\ the\ result\ board).\r\n\ Try\ to\ keep\ the\ name\ short\ so\ that\ it\ displays\ nicely\ on\ the\ result\ board.\r\n
comment20.params=slot
comment20.target=int\ getMemory(int)
comment20.text=\r\n\ Retrieve\ a\ previously\ stored\ value.\r\n\ \r\n\ Other\ friendly\ greeps\ are\ allowed\ to\ call\ this\ mehtod.\r\n
comment21.params=flagNo\ val
comment21.target=void\ setFlag(int,\ boolean)
comment21.text=\r\n\ Store\ a\ user\ defined\ boolean\ value\ (a\ "flag").\ Two\ flags\ are\ available,\ \r\n\ i.e.\ 'flagNo'\ may\ be\ 1\ or\ 2.\r\n
comment22.params=flagNo
comment22.target=boolean\ getFlag(int)
comment22.text=\r\n\ Retrieve\ the\ value\ of\ a\ flag.\ 'flagNo'\ can\ be\ 1\ or\ 2.\r\n\ \r\n\ Other\ friendly\ greeps\ are\ allowed\ to\ call\ this\ mehtod.\r\n
comment23.params=
comment23.target=boolean\ isBlocking()
comment23.text=\r\n\ Return\ true\ if\ this\ greep\ is\ in\ "blocking"\ mode\ -\ it\ has\ hunkered\ down\ to\r\n\ prevent\ opponent\ greeps\ from\ passing\ (while\ allowing\ friendly\ greeps\ through).\r\n
comment24.params=
comment24.target=void\ block()
comment24.text=\r\n\ Block\ opponent\ greeps\ from\ passing\ our\ current\ location.\ This\ is\ only\ effective\ if\r\n\ we\ haven't\ moved\ (can't\ move\ and\ block\ in\ the\ same\ turn).\r\n
comment25.params=
comment25.target=void\ kablam()
comment25.text=\r\n\ Release\ a\ stink\ bomb.\ All\ greeps\ within\ a\ small\ radius\ will\ be\ knocked\ out\ for\r\n\ a\ small\ period\ of\ time.\ If\ a\ greep\ carrying\ a\ tomato\ is\ knocked\ out,\ it\ will\ drop\r\n\ the\ tomato\ on\ the\ ground.\r\n
comment26.params=x\ y
comment26.target=boolean\ canMoveTo(int,\ int)
comment26.text=\r\n\ True\ if\ we\ can\ move\ to\ the\ given\ location\ without\ being\ blocked\ by\ water,\ the\ edge\r\n\ of\ the\ map\ or\ a\ blocking\ opponent.\r\n
comment27.params=x\ y
comment27.target=boolean\ blocks(int,\ int)
comment27.text=\r\n\ True\ if\ this\ greep\ is\ blocking\ the\ given\ position.\r\n
comment28.params=
comment28.target=void\ carryTomato()
comment28.text=\r\n\ Receive\ a\ tomato\ and\ carry\ it.\r\n
comment29.params=
comment29.target=void\ leaveTomato()
comment29.text=\r\n\ Leave\ the\ tomato\ we\ are\ carrying.\ \r\n\ It\ will\ put\ the\ tomato\ on\ the\ ground\ -\ forming\ a\ pile\ of\ one\ tomato.\r\n
comment3.params=angle
comment3.target=void\ turn(int)
comment3.text=\r\n\ Turn\ 'angle'\ degrees\ towards\ the\ right\ (clockwise).\r\n
comment30.params=
comment30.target=void\ keelOver()
comment30.text=\r\n\ Make\ this\ greep\ flip.\r\n
comment31.params=
comment31.target=java.lang.String\ getCurrentImage()
comment31.text=\r\n\ This\ method\ specifies\ the\ image\ we\ want\ displayed\ at\ any\ time.\r\n
comment32.params=
comment32.target=boolean\ isTeamTwo()
comment32.text=\r\n\ Return\ true\ if\ this\ is\ team\ 2,\ false\ if\ it\ is\ team\ 1.\r\n
comment33.params=x\ y
comment33.target=int\ getAngleTo(int,\ int)
comment33.text=\r\n\ Return\ the\ angle\ from\ the\ origin\ (0,0)\ to\ some\ point\ (x,y),\ in\ degrees\r\n
comment34.params=x\ y
comment34.target=int\ distanceTo(int,\ int)
comment34.text=\r\n\ Return\ the\ distance\ between\ this\ greep\ and\ an\ arbitrary\ point.\r\n
comment4.params=
comment4.target=void\ turnHome()
comment4.text=\r\n\ Turn\ in\ the\ direction\ facing\ the\ home\ ship.\r\n
comment5.params=x\ y
comment5.target=void\ turnTowards(int,\ int)
comment5.text=\r\n\ Turn\ to\ face\ an\ arbitrary\ point\ on\ the\ map.\r\n
comment6.params=
comment6.target=boolean\ atShip()
comment6.text=\r\n\ True\ if\ we\ are\ at\ our\ space\ ship.\r\n
comment7.params=
comment7.target=int[]\ getShipData()
comment7.text=\r\n\ Get\ the\ ship's\ data\ bank\ array\ (1000\ ints).\r\n\ This\ can\ only\ be\ done\ if\ the\ greep\ is\ at\ the\ ship.\r\n\ The\ data\ inside\ the\ array\ can\ be\ freely\ manipulated.\r\n
comment8.params=
comment8.target=void\ move()
comment8.text=\r\n\ Try\ and\ move\ forward\ in\ the\ current\ direction.\ If\ we\ are\ blocked\ (by\ water,\ or\ an\r\n\ opponent\ greep\ who\ is\ blocking),\ we\ won't\ move;\ atWater()/moveWasBlocked()\ can\ be\r\n\ used\ to\ check\ for\ this,\ and\ in\ that\ case,\ it\ is\ allowed\ to\ change\ direction\ and\ try\r\n\ move()ing\ again.\r\n
comment9.params=
comment9.target=boolean\ atWater()
comment9.text=\r\n\ Return\ true\ if\ we\ have\ just\ seen\ water\ in\ front\ of\ us.\ \r\n\ The\ edge\ of\ the\ map\ is\ also\ water.\r\n
numComments=35