empi 0.19 → 0.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,372 +0,0 @@
1
- /-- /// /-/ -/-
2
- /-- ||| /-/ |
3
- /-- ||| | -/-
4
-
5
- Empi: Ruby Edition
6
- ====================
7
- CC-BY-SA 3.0, Detros
8
- http://www.bay12forums.com/smf/index.php?topic=157538
9
- https://rubygems.org/gems/empi
10
- rasunadon@seznam.cz
11
-
12
-
13
- v19 dev
14
- =========
15
- - units which can't build will not only protest against such function but also not set it
16
- fixed: units which can't build can still have function set to build
17
- - added link to the gem page to the header of this Info file
18
- - defenders of capturable units need to be dealt with before it can be captured
19
- fixed: capturing town with units leaves those enemy units inside
20
- - destroyed transporters first destroy their cargo
21
- fixed: destroyed transport ships don't give points for their lost cargo
22
- - apparently fixed in v0.18 with storing of last unit in cursor
23
- fixed: transported units show in infopane info of their transport instead when selected
24
- - cargo part of info shown even for empty transporters
25
- - UnitFunction stores its unit
26
- fixed: transported units don't function properly, their transports secretly function instead of them
27
- - preliminary work done on setting build projects
28
- - towns say what their project and its progress are
29
- - parts are first build and then checked so building process takes one less turn now
30
- - captured towns have their build process reset
31
- - reworded function parts of unit info
32
-
33
- newly found issues
34
- --------------------
35
- ! passing a Window to Image.from_text has been deprecated since Gosu 0.9
36
- ! Fontconfig error: failed reading config file
37
- ! no way to list cargo in loaded maps
38
- ! units loaded from tile can spawn on unsuitable terrain
39
-
40
- file changes
41
- --------------
42
- army.rb
43
- PARTS_TO_BE_BUILT
44
-
45
- cursor.rb
46
- removed debug printouts from to_next_unit!()
47
-
48
- empi.rb
49
- added Build function to help
50
-
51
- ship
52
- PARTS_TO_BE_BUILT
53
-
54
- unit.rb
55
- set_function(func) properly returns if it tries to set build function for unit which can't build
56
- capture(by_whom) renamed to capture!(by_whom)
57
- destroy(by_whom) renamed to destroy!(by_whom)
58
- tile_check() renamed to is_terrain_suitable?()
59
- +engage!(by_whom) - Process engagement targeted at this unit
60
- +attack!(by_whom) - Process attack targeted at this unit
61
- capture!(by_whom) checks if unit can be captured and if capturing faction is different from current one
62
- destroy!(by_whom) removes from cargo of its transporter when transported
63
- cargo part shortened in info()
64
- positive cargo_max used instead of cargo size to show cargo part of info
65
- simplified calling of UnitFunction in function!
66
- set_function(func) renamed to set_function!(func)
67
- PARTS_TO_BE_BUILT
68
- moved build part of capture! to Town
69
- moved build part of set_function! to Town
70
- +can_be_built?
71
-
72
- unitFunction.rb
73
- removed PARTS_NEEDED
74
- @unit
75
- states project and its state when building in func!()
76
- loading needed unit parameters from its stored unit in func!()
77
- +info() - Set function part of long info string of unit
78
-
79
- town.rb
80
- @parts_needed
81
- @project
82
- +build_info - Tell the state of current build project
83
- +capture!(by_whom) - Process capture targeted at this town and reset build process
84
- +set_function(func) - Set desired function and possibly also project
85
- +set_project! - Set desired project
86
-
87
- save/m02-err.esf
88
- copy of m02 with two extra units on unsuitable terrain
89
-
90
- v18 dev
91
- =========
92
- - help is now listing all keys
93
- - help shown after the first load of new map
94
- - units use all left moves when loaded, unless they are loaded into towns
95
- - even units with 0 moves left show their moves in their info
96
- - added "End of turn" marker
97
- - added licensing/contact info also to this info file and not just to gem specs
98
- - several exception handlers added to Cursor
99
- - units stored in Tile class
100
- fixed: units are still stored via Map class instead of Tile one
101
- - movement and function keys processed in Cursor, movement checked in Unit
102
- fixed: units are still accessed via Window class instead of Cursor one
103
- - moving of cursor stores the current unit so it can possibly get moved (again)
104
- - function setting of units separated to its own method
105
- - autodisabling of freeroam mode on each end of turn moved to the start of next turn
106
-
107
- newly found issues
108
- --------------------
109
- ! help should be shown after each load of new map
110
- ! transported units can't get commands from freeroaming cursor
111
- ! transported units don't function properly, their transports secretly function instead of them
112
- ! unit info shown twice at the start of the first turn
113
- ! units which can't build can still have function set to build (though they do protest)
114
-
115
- file changes
116
- --------------
117
- empi.rb
118
- help shown at the start of game
119
- added End turn and End game keys to help()
120
- "End of turn" marker
121
- removed calling of @map.draw_units
122
- removed search for next movable unit
123
-
124
- map.rb
125
- all_map_units() uses indirect access via get_unit()
126
- get_unit(), set_unit() access given coordinates of @tiles
127
- draw_units() and @units removed
128
-
129
- unit.rb
130
- removed processing of movement and function keys
131
- info() uses @moves_max > 0 instead of can_move()
132
- check_movement() sets @moves_left to 1 when unit is loaded so it then gets lowered to 0
133
-
134
- cursor.rb
135
- switch_freeroam() renamed to switch_freeroam!()
136
- +move! - Move by given change of coordinates
137
- +to_next_unit! - Find next unit to target with cursor
138
- @unit
139
- +set_function_to_unit(func) - Tries to set function <func> to currently selected unit
140
-
141
- tile.rb
142
- @unit
143
-
144
- infopane.rb
145
- removed one space from score output
146
-
147
- docu/Empi v18.png
148
- docu/Empi v18 - printouts.png
149
-
150
- v17 dev
151
- =========
152
- - selected map: m02
153
- - terrain stuff separated to Tile class
154
- ! units are still stored via Map class instead of Tile one
155
- ! units are still accessed via Window class instead of Cursor one
156
- - removed debug printout from Unit class
157
- - moving transports don't leave their cargo behind
158
- - capturing done only by armies
159
- fixed: all units can capture towns (armies visiting towns are left allowed for now)
160
- - only towns can be captured, other units do battle
161
- fixed: battling units capture instead of damaging
162
- ! capturing town with units leaves those enemy units inside
163
- ! damaged units are destroyed
164
- - printouts tweaked
165
- fixed: transported units show only info of their transport instead when selected
166
- ! transported units show in infopane info of their transport instead when selected
167
- ! destroyed transport ships don't give points for their lost cargo
168
-
169
- file changes
170
- --------------
171
- empi.rb
172
- cursor prints out info() even for not moved units
173
- (say, when friend unit without avaiable cargo capacity was on the destination tile)
174
- added PROMPT to responding printouts
175
-
176
- cursor.rb
177
- info() shows info of transported units too
178
-
179
- map.rb
180
- TILE constants moved to tile.rb
181
- initialize() sets tile and leaves processing of loaded symbol to it
182
- tile() returns object of tile instead directly its terrain type
183
- +all_tiles - Return all tiles
184
- draw_tiles
185
-
186
- unit.rb
187
- removed debug printout used for checking of units leaving towns
188
- added PROMPT to responding printouts
189
- check_movement() makes sure cargo is moved too
190
- check_movement() checks if moved unit has enough move points
191
- check_movement() print outs are more detailed
192
- tile_check() doesn't check terrain type for transported units
193
- info() prints out also max cargo capacity
194
- fixed comparing of functions in set_function()
195
- +can_capture?
196
- +can_be_captured?
197
- can_move() renamed to can_move?()
198
- reset_moves() renamed to reset_moves!()
199
-
200
- army.rb
201
- can capture
202
-
203
- town.rb
204
- can be captured
205
-
206
- save/m02.esf
207
- +two ships, one for each faction
208
-
209
- tile.rb
210
-
211
-
212
- v16 dev
213
- =========
214
- - units on sentry duty say so when functioning
215
- - neutral units can't have functions
216
- - links to media and save files use full path
217
- - towns build armies
218
- fixed: no building of units
219
- ! hardcoded unit type to be built
220
- - units can transport other units
221
- - newly built units are stored in town instead of map
222
- fixed: new units are saved in map instead of the towns that built them
223
- ! transported units are never drawn
224
- ! transported units show only info of their transport instead when selected
225
- ! all units can capture and visit towns
226
-
227
- file changes
228
- --------------
229
- map.rb
230
- initialize() uses full paths to files
231
- all_units renamed to all_map_units() - Return only units directly on map
232
- +all_transported_units() - Return only units transported by other units
233
- +all_units() - Return both map units and transported units
234
- draw_units() draws only map units
235
-
236
- unit.rb
237
- +@cargo, @cargo_max
238
- +can_transport?() - Unit is able to both transport other units and currently has some space left
239
- set_function() checks for @faction == 0
240
- checking of movement separated from update()
241
- +check_movement() - Processes move of unit and takes care of its (un)loading or attack
242
- capture() makes newly captured towns start building
243
-
244
- town.rb
245
- initialize() uses full path to file
246
- +parts_built
247
- +@cargo_max set to 10
248
-
249
- army.rb
250
- initialize() uses full path to file
251
-
252
- ship.rb
253
- initialize() uses full path to file
254
- +@cargo_max set to 3
255
-
256
- unitFunction.rb
257
- +FUNCBUILD case in func!()
258
- FUNCSENTRY case in func!() sets "ret" even when unit keeps sentrying
259
-
260
-
261
- v15 dev
262
- =========
263
- - selected map: m03
264
- - units referenced only from map
265
- fixed: no destruction of units
266
- - loading of units from file
267
- fixed: no loading
268
- - checks of loaded terrain tiles and units
269
- - map stored as [row, column], not [xx, yy]
270
-
271
- file changes
272
- --------------
273
- empi.rb
274
- -scenario_units() - Return list of units for given scenario
275
-
276
- map.rb
277
- load_map() now loads units too
278
- load_head() now returns number of units to load too
279
- load_map(), tile(), get_unit(), set_unit() use rr and cc instead of xx and yy
280
- +load_unit() - Load one unit from given line
281
- +draw_units() - Draw all units
282
-
283
- save/m01.esf
284
- 8 units from old empi.scenario_units()
285
-
286
- save/m02.esf
287
- 10 units similar to old empi.scenario_units()
288
-
289
- save/m03.esf
290
-
291
-
292
- v14 dev
293
- =========
294
- - loading of terrain tiles from file
295
- fixed: hardcoded starting scenario
296
- ! hardcoded save file name
297
- ! hardcoded map size
298
-
299
- file changes
300
- --------------
301
- empi.rb
302
- TILE constants moved to map.rb
303
-
304
- map.rb
305
- -scenario_tiles() - Return map tile for given scenario
306
- +load_map() - Load map from file (for now only terrain tiles)
307
- +load_head() - Load head row of file
308
-
309
- unit.rb
310
- removed generic unit image
311
-
312
- save/m01.esf
313
- save/m02.esf
314
-
315
-
316
- older versions
317
- ================
318
- - towns and armies
319
- - functions none and sentry
320
- - armor and movement points
321
- - movement of units
322
- - rudimentary terrain checking after move
323
- - capturing of units
324
- - turn and score counting
325
- - command line and screen text output
326
- - next available unit / freeroam cursor
327
-
328
-
329
- current state
330
- ===============
331
- old wishlist
332
- ! no panning of map
333
- !x no destruction of units
334
- !x no building of units
335
- ! no victory conditions
336
- !x battling units capture instead of damaging
337
- ! attacker always wins
338
- ! player playing both factions at once
339
- !x hardcoded starting scenario
340
- ! no fog of war
341
- ! no saving
342
- !x no loading
343
- ! no title screen
344
- ! no highscore screen
345
- ! no settings
346
- ! no sound, no music
347
-
348
- new problems
349
- ! hardcoded save file name
350
- ! hardcoded map size
351
- ! hardcoded unit type to be built
352
- ! transported units are never drawn
353
- !x transported units show only info of their transport instead when selected
354
- !x all units can capture towns
355
- !x all units can visit towns
356
- !x units are still stored via Map class instead of Tile one
357
- !x units are still accessed via Window class instead of Cursor one
358
- !x capturing town with units leaves those enemy units inside
359
- ! damaged units are destroyed
360
- !x transported units show in infopane info of their transport instead when selected
361
- !x destroyed transport ships don't give points for their lost cargo
362
- ! help should be shown after each load of new map
363
- ! transported units can't get commands from freeroaming cursor
364
- !x transported units don't function properly, their transports secretly function instead of them
365
- ! unit info shown twice at the start of the first turn
366
- !x units which can't build can still have function set to build
367
- ! passing a Window to Image.from_text has been deprecated since Gosu 0.9
368
- ! Fontconfig error: failed reading config file
369
- ! no way to list cargo in loaded maps
370
- ! units loaded from tile can spawn on unsuitable terrain
371
-
372
- (! thing to fix, !x fixed thing)
@@ -1,36 +0,0 @@
1
- # Score, turn and event texts
2
- class Infopane
3
- attr_writer :text, :act_fact
4
-
5
- def initialize
6
- @score = [0, 0]
7
- @turn = 0
8
- @act_fact = 0 # active faction
9
- @text = 'ready'
10
- end
11
-
12
- def update
13
- end
14
-
15
- def draw
16
- turnscore = Gosu::Image.from_text(
17
- self, "Turn: #{@turn}, Score: #{@score[0]} - #{@score[1]}", Gosu.default_font_name, 20)
18
- turnscore.draw(XTEXT, YTEXT, ZTEXT)
19
-
20
- text = Gosu::Image.from_text(self, "#{@text}", Gosu.default_font_name, 20)
21
- text.draw(XTEXT, (TILESIZE / 2) + YTEXT, ZTEXT)
22
- end
23
-
24
- def next_faction
25
- # TODO active faction switching
26
- end
27
-
28
- def next_turn
29
- @turn += 1
30
- puts "Turn: #{@turn}, Score: #{@score[0]} - #{@score[1]}"
31
- end
32
-
33
- def add_score(to_whom, how_much)
34
- @score[to_whom] += how_much
35
- end
36
- end
@@ -1,36 +0,0 @@
1
- TILE_SEA = 0
2
- TILE_GROUND = 1
3
-
4
- SYMBOL_SEA = '.'
5
- SYMBOL_GROUND = '#'
6
-
7
- class Tile
8
- attr_accessor :terrain, :infopane, :unit
9
-
10
- def initialize(x, y, loaded_symbol, infopane)
11
- dir_path = File.dirname(__FILE__)
12
-
13
- @x = x
14
- @y = y
15
- @infopane = infopane
16
-
17
- case(loaded_symbol)
18
- when SYMBOL_SEA then
19
- @terrain = TILE_SEA
20
- @image = Gosu::Image.new(dir_path + '/media/sea.png')
21
- when SYMBOL_GROUND then
22
- @terrain = TILE_GROUND
23
- @image = Gosu::Image.new(dir_path + '/media/ground.png')
24
- else
25
- abort("tile.initialize(): Unknown terrain symbol (#{loaded_symbol})")
26
- end
27
- end
28
-
29
- def draw
30
- @image.draw(@x * TILESIZE, (@y + 1) * TILESIZE, ZTILE)
31
-
32
- if @unit
33
- @unit.draw
34
- end
35
- end
36
- end
@@ -1,77 +0,0 @@
1
- require_relative './unit'
2
-
3
- class Town < Unit
4
- attr_accessor :project, :parts_built, :parts_needed
5
-
6
- def initialize(x, y, faction, map, infopane)
7
- super
8
- dir_path = File.dirname(__FILE__)
9
- @image = Gosu::Image.new(dir_path + '/media/town.png')
10
-
11
- @name = 'town'
12
- @value = 20
13
- @armor_left = @armor_max = 1
14
- @moves_max = 0
15
- @cargo_max = 10
16
-
17
- @parts_built = 0
18
- @parts_needed = 0
19
- @project = nil
20
-
21
- set_function!(FUNCBUILD)
22
- end
23
-
24
- def can_build?
25
- true
26
- end
27
-
28
- def can_be_captured?
29
- true
30
- end
31
-
32
- # Tell the state of current build project
33
- def build_info
34
- "#{@parts_built}/#{@parts_needed}"
35
- end
36
-
37
- # Process capture targeted at this town and reset build process
38
- def capture!(by_whom)
39
- super
40
-
41
- # Reset build process
42
- @project = nil
43
- @parts_built = 0
44
- set_function!(FUNCBUILD)
45
- end
46
-
47
- # Set desired function and possibly also project
48
- def set_function!(func)
49
- super
50
-
51
- if @faction != 0 and func == FUNCBUILD # neutral towns dom't need projects either
52
- set_project!
53
- end
54
- end
55
-
56
- # Set desired project
57
- def set_project!
58
- @desired_project = "army" # TODO ask for input on what to build
59
- @parts_needed = 3 # TODO load from given project class
60
-
61
- if @desired_project == @project
62
- puts PROMPT + to_s + ": project has already been set to #{@project} (#{build_info} done)"
63
- else
64
- previous_project = @project
65
- @project = @desired_project
66
- lost_parts = @parts_built
67
- @parts_built = 0
68
-
69
- new_project_set_text = PROMPT + to_s + ": project set to #{@project} (#{build_info} done)"
70
- unless lost_parts > 0
71
- puts new_project_set_text
72
- else
73
- puts new_project_set_text + ", losing #{lost_parts} parts of #{previous_project} "
74
- end
75
- end
76
- end
77
- end