From fb5a98b72ab79949d1da7f75a3d6150c2906ef40 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Mon, 30 Aug 2021 14:48:06 +0200 Subject: gui: tech representation, menu, tile & unit info, attack info --- CMakeFiles/sdl_test.dir/CXX.includecache | 1120 ++++++++++++++++++++ CMakeFiles/sdl_test.dir/depend.internal | 1 + CMakeFiles/sdl_test.dir/depend.make | 1 + CMakeFiles/sdl_test.dir/game/ground.cpp.obj | Bin 184154 -> 184139 bytes CMakeFiles/sdl_test.dir/game/gst.cpp.obj | Bin 162940 -> 166407 bytes CMakeFiles/sdl_test.dir/game/load.cpp.obj | Bin 2080546 -> 2113607 bytes CMakeFiles/sdl_test.dir/game/menu.cpp.obj | Bin 47831 -> 182045 bytes CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj | Bin 380835 -> 443933 bytes CMakeFiles/sdl_test.dir/game/view.cpp.obj | Bin 14430 -> 15564 bytes CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj | Bin 87662 -> 226173 bytes CMakeFiles/sdl_test.dir/main.cpp.obj | Bin 267872 -> 302022 bytes CMakeFiles/sdl_test.dir/objects.a | Bin 3639720 -> 4076418 bytes build/content/entities.json | 155 ++- build/content/gf.bmp | Bin 28474 -> 28474 bytes build/content/sprites.bmp | Bin 3145782 -> 3145782 bytes build/content/techs.json | 696 ++++++------ build/content/tiles.json | 2 +- build/sdl_test.exe | Bin 1878308 -> 2056346 bytes game/entity.h | 2 +- game/ground.cpp | 4 +- game/gst.cpp | 142 ++- game/gst.h | 18 + game/load.cpp | 16 + game/menu.cpp | 48 + game/menu.h | 25 +- game/player.h | 2 + game/playercontrol.cpp | 47 +- game/playercontrol.h | 1 + game/tech.h | 3 + game/view.cpp | 55 +- game/view.h | 2 + graphics/graphics.cpp | 411 ++++++- graphics/graphics.h | 1 + main.cpp | 7 +- 34 files changed, 2343 insertions(+), 416 deletions(-) diff --git a/CMakeFiles/sdl_test.dir/CXX.includecache b/CMakeFiles/sdl_test.dir/CXX.includecache index 60ea70a..cf9bd6c 100644 --- a/CMakeFiles/sdl_test.dir/CXX.includecache +++ b/CMakeFiles/sdl_test.dir/CXX.includecache @@ -6,6 +6,636 @@ #IncludeRegexTransform: +C:/MinGW_libs/include/SDL2/SDL.h +SDL_main.h +C:/MinGW_libs/include/SDL2/SDL_main.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_assert.h +C:/MinGW_libs/include/SDL2/SDL_assert.h +SDL_atomic.h +C:/MinGW_libs/include/SDL2/SDL_atomic.h +SDL_audio.h +C:/MinGW_libs/include/SDL2/SDL_audio.h +SDL_clipboard.h +C:/MinGW_libs/include/SDL2/SDL_clipboard.h +SDL_cpuinfo.h +C:/MinGW_libs/include/SDL2/SDL_cpuinfo.h +SDL_endian.h +C:/MinGW_libs/include/SDL2/SDL_endian.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_events.h +C:/MinGW_libs/include/SDL2/SDL_events.h +SDL_filesystem.h +C:/MinGW_libs/include/SDL2/SDL_filesystem.h +SDL_gamecontroller.h +C:/MinGW_libs/include/SDL2/SDL_gamecontroller.h +SDL_haptic.h +C:/MinGW_libs/include/SDL2/SDL_haptic.h +SDL_hints.h +C:/MinGW_libs/include/SDL2/SDL_hints.h +SDL_joystick.h +C:/MinGW_libs/include/SDL2/SDL_joystick.h +SDL_loadso.h +C:/MinGW_libs/include/SDL2/SDL_loadso.h +SDL_log.h +C:/MinGW_libs/include/SDL2/SDL_log.h +SDL_messagebox.h +C:/MinGW_libs/include/SDL2/SDL_messagebox.h +SDL_metal.h +C:/MinGW_libs/include/SDL2/SDL_metal.h +SDL_mutex.h +C:/MinGW_libs/include/SDL2/SDL_mutex.h +SDL_power.h +C:/MinGW_libs/include/SDL2/SDL_power.h +SDL_render.h +C:/MinGW_libs/include/SDL2/SDL_render.h +SDL_rwops.h +C:/MinGW_libs/include/SDL2/SDL_rwops.h +SDL_sensor.h +C:/MinGW_libs/include/SDL2/SDL_sensor.h +SDL_shape.h +C:/MinGW_libs/include/SDL2/SDL_shape.h +SDL_system.h +C:/MinGW_libs/include/SDL2/SDL_system.h +SDL_thread.h +C:/MinGW_libs/include/SDL2/SDL_thread.h +SDL_timer.h +C:/MinGW_libs/include/SDL2/SDL_timer.h +SDL_version.h +C:/MinGW_libs/include/SDL2/SDL_version.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_assert.h +SDL_config.h +C:/MinGW_libs/include/SDL2/SDL_config.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +signal.h +- +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_atomic.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_platform.h +C:/MinGW_libs/include/SDL2/SDL_platform.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +sys/cpuinline.h +- +mbarrier.h +- +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_audio.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_endian.h +C:/MinGW_libs/include/SDL2/SDL_endian.h +SDL_mutex.h +C:/MinGW_libs/include/SDL2/SDL_mutex.h +SDL_thread.h +C:/MinGW_libs/include/SDL2/SDL_thread.h +SDL_rwops.h +C:/MinGW_libs/include/SDL2/SDL_rwops.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_blendmode.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_clipboard.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_config.h +SDL_platform.h +C:/MinGW_libs/include/SDL2/SDL_platform.h + +C:/MinGW_libs/include/SDL2/SDL_cpuinfo.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +intrin.h +- +intrin.h +- +altivec.h +- +arm_neon.h +- +armintr.h +- +arm_neon.h +- +arm64intr.h +- +arm64_neon.h +- +mm3dnow.h +- +immintrin.h +- +mmintrin.h +- +xmmintrin.h +- +emmintrin.h +- +pmmintrin.h +- +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_endian.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +endian.h +- +endian.h +- +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_events.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +SDL_keyboard.h +C:/MinGW_libs/include/SDL2/SDL_keyboard.h +SDL_mouse.h +C:/MinGW_libs/include/SDL2/SDL_mouse.h +SDL_joystick.h +C:/MinGW_libs/include/SDL2/SDL_joystick.h +SDL_gamecontroller.h +C:/MinGW_libs/include/SDL2/SDL_gamecontroller.h +SDL_quit.h +C:/MinGW_libs/include/SDL2/SDL_quit.h +SDL_gesture.h +C:/MinGW_libs/include/SDL2/SDL_gesture.h +SDL_touch.h +C:/MinGW_libs/include/SDL2/SDL_touch.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_filesystem.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_gamecontroller.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_rwops.h +C:/MinGW_libs/include/SDL2/SDL_rwops.h +SDL_joystick.h +C:/MinGW_libs/include/SDL2/SDL_joystick.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_gesture.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +SDL_touch.h +C:/MinGW_libs/include/SDL2/SDL_touch.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_haptic.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_joystick.h +C:/MinGW_libs/include/SDL2/SDL_joystick.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_hints.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_joystick.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_keyboard.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_keycode.h +C:/MinGW_libs/include/SDL2/SDL_keycode.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_keycode.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_scancode.h +C:/MinGW_libs/include/SDL2/SDL_scancode.h + +C:/MinGW_libs/include/SDL2/SDL_loadso.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_log.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_main.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_messagebox.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_metal.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_mouse.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_mutex.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_pixels.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_endian.h +C:/MinGW_libs/include/SDL2/SDL_endian.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_platform.h +AvailabilityMacros.h +C:/MinGW_libs/include/SDL2/AvailabilityMacros.h +TargetConditionals.h +C:/MinGW_libs/include/SDL2/TargetConditionals.h +winapifamily.h +- +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_power.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_quit.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h + +C:/MinGW_libs/include/SDL2/SDL_rect.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_pixels.h +C:/MinGW_libs/include/SDL2/SDL_pixels.h +SDL_rwops.h +C:/MinGW_libs/include/SDL2/SDL_rwops.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_render.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_rect.h +C:/MinGW_libs/include/SDL2/SDL_rect.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_rwops.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_scancode.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h + +C:/MinGW_libs/include/SDL2/SDL_sensor.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_shape.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_pixels.h +C:/MinGW_libs/include/SDL2/SDL_pixels.h +SDL_rect.h +C:/MinGW_libs/include/SDL2/SDL_rect.h +SDL_surface.h +C:/MinGW_libs/include/SDL2/SDL_surface.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_config.h +C:/MinGW_libs/include/SDL2/SDL_config.h +sys/types.h +- +stdio.h +- +stdlib.h +- +stddef.h +- +stdarg.h +- +stdlib.h +- +malloc.h +- +stddef.h +- +stdarg.h +- +memory.h +- +string.h +- +strings.h +- +wchar.h +- +inttypes.h +- +stdint.h +- +ctype.h +- +math.h +- +float.h +- +alloca.h +- +malloc.h +- +malloc.h +- +malloc.h +- +stdlib.h +- +sal.h +- +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_surface.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_pixels.h +C:/MinGW_libs/include/SDL2/SDL_pixels.h +SDL_rect.h +C:/MinGW_libs/include/SDL2/SDL_rect.h +SDL_blendmode.h +C:/MinGW_libs/include/SDL2/SDL_blendmode.h +SDL_rwops.h +C:/MinGW_libs/include/SDL2/SDL_rwops.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_system.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_keyboard.h +C:/MinGW_libs/include/SDL2/SDL_keyboard.h +SDL_render.h +C:/MinGW_libs/include/SDL2/SDL_render.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_thread.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_atomic.h +C:/MinGW_libs/include/SDL2/SDL_atomic.h +SDL_mutex.h +C:/MinGW_libs/include/SDL2/SDL_mutex.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +process.h +- +process.h +- +stdlib.h +- +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_timer.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_touch.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_error.h +C:/MinGW_libs/include/SDL2/SDL_error.h +SDL_video.h +C:/MinGW_libs/include/SDL2/SDL_video.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_version.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/SDL_video.h +SDL_stdinc.h +C:/MinGW_libs/include/SDL2/SDL_stdinc.h +SDL_pixels.h +C:/MinGW_libs/include/SDL2/SDL_pixels.h +SDL_rect.h +C:/MinGW_libs/include/SDL2/SDL_rect.h +SDL_surface.h +C:/MinGW_libs/include/SDL2/SDL_surface.h +begin_code.h +C:/MinGW_libs/include/SDL2/begin_code.h +close_code.h +C:/MinGW_libs/include/SDL2/close_code.h + +C:/MinGW_libs/include/SDL2/begin_code.h + +C:/MinGW_libs/include/SDL2/close_code.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/commands/commands.h +iostream +- +vector +- +SDL2/SDL.h +- + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.cpp +entity.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h +iostream +- + C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h vector - @@ -16,6 +646,16 @@ iostream ../umath/vec2.h C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.cpp +ground.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.h +gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +iostream +- +algorithm +- + C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.h entity.h C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h @@ -48,10 +688,410 @@ C:/Users/jaksk/Desktop/dev/_cpp/age/game/player.h tech.h C:/Users/jaksk/Desktop/dev/_cpp/age/game/tech.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/load.cpp +iostream +- +fstream +- +vector +- +load.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/load.h +nlohmann/json.hpp +C:/Users/jaksk/Desktop/dev/_cpp/age/game/nlohmann/json.hpp + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/load.h +gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/menu.h +vector +- +string +- +../umath/vec2.h +C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h +tech.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/tech.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/nlohmann/json.hpp +algorithm +- +cstddef +- +functional +- +initializer_list +- +iosfwd +- +iterator +- +memory +- +numeric +- +string +- +utility +- +vector +- +type_traits +- +utility +- +algorithm +- +array +- +forward_list +- +iterator +- +map +- +string +- +tuple +- +type_traits +- +unordered_map +- +utility +- +valarray +- +exception +- +stdexcept +- +string +- +vector +- +array +- +cstddef +- +cstdint +- +string +- +string +- +utility +- +stdint.h +- +stdint.h +- +cstdlib +- +cassert +- +cstddef +- +cstddef +- +type_traits +- +utility +- +limits +- +type_traits +- +utility +- +tuple +- +iterator +- +type_traits +- +cstdint +- +map +- +memory +- +string +- +vector +- +algorithm +- +iterator +- +string +- +tuple +- +type_traits +- +utility +- +valarray +- +vector +- +cstddef +- +iterator +- +string +- +tuple +- +utility +- +cstdint +- +tuple +- +utility +- +cstdint +- +cstddef +- +functional +- +algorithm +- +array +- +cmath +- +cstddef +- +cstdint +- +cstdio +- +cstring +- +iterator +- +limits +- +string +- +utility +- +vector +- +array +- +cstddef +- +cstring +- +iterator +- +memory +- +numeric +- +string +- +type_traits +- +utility +- +cstdio +- +istream +- +cstddef +- +string +- +utility +- +vector +- +array +- +clocale +- +cstddef +- +cstdio +- +cstdlib +- +initializer_list +- +string +- +utility +- +vector +- +cstdint +- +utility +- +string +- +cmath +- +cstdint +- +functional +- +string +- +utility +- +vector +- +cstddef +- +limits +- +iterator +- +type_traits +- +cstddef +- +iterator +- +utility +- +algorithm +- +cctype +- +limits +- +numeric +- +string +- +utility +- +vector +- +initializer_list +- +utility +- +algorithm +- +array +- +cmath +- +cstdint +- +cstring +- +limits +- +string +- +utility +- +algorithm +- +cstddef +- +iterator +- +memory +- +string +- +vector +- +ios +- +ostream +- +algorithm +- +array +- +clocale +- +cmath +- +cstddef +- +cstdint +- +cstdio +- +limits +- +string +- +type_traits +- +utility +- +array +- +cmath +- +cstdint +- +cstring +- +limits +- +type_traits +- +functional +- +initializer_list +- +iterator +- +memory +- +stdexcept +- +type_traits +- +utility +- +vector +- +string_view +- + C:/Users/jaksk/Desktop/dev/_cpp/age/game/player.h vector - +C:/Users/jaksk/Desktop/dev/_cpp/age/game/playercontrol.cpp +iostream +- +string +- +playercontrol.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/playercontrol.h +entity.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/playercontrol.h +iostream +- +gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +view.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/view.h +vector +- +functional +- + C:/Users/jaksk/Desktop/dev/_cpp/age/game/tech.h vector - @@ -68,5 +1108,85 @@ string ../umath/vec2.h C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/view.cpp +view.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/view.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/game/view.h +vector +- +functional +- +gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +menu.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/menu.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/cam.h +vector +- + +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/graphics.cpp +algorithm +- +iostream +- +string +- +math.h +- +graphics.h +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/graphics.h +../game/menu.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/menu.h +../game/tile.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/tile.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/graphics.h +vector +- +string +- +SDL2/SDL.h +- +../game/gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +../game/view.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/view.h +cam.h +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/cam.h +string +- + +C:/Users/jaksk/Desktop/dev/_cpp/age/main.cpp +iostream +- +vector +- +umath/vec2.h +C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h +graphics/graphics.h +C:/Users/jaksk/Desktop/dev/_cpp/age/graphics/graphics.h +commands/commands.h +C:/Users/jaksk/Desktop/dev/_cpp/age/commands/commands.h +timing/timing.h +C:/Users/jaksk/Desktop/dev/_cpp/age/timing/timing.h +game/entity.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h +game/ground.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.h +game/playercontrol.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/playercontrol.h +game/gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +game/tile.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/tile.h +game/load.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/load.h + +C:/Users/jaksk/Desktop/dev/_cpp/age/timing/timing.h +SDL2/SDL.h +- + C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h diff --git a/CMakeFiles/sdl_test.dir/depend.internal b/CMakeFiles/sdl_test.dir/depend.internal index 67a2d8e..f191c0c 100644 --- a/CMakeFiles/sdl_test.dir/depend.internal +++ b/CMakeFiles/sdl_test.dir/depend.internal @@ -86,6 +86,7 @@ CMakeFiles/sdl_test.dir/game/load.cpp.obj CMakeFiles/sdl_test.dir/game/menu.cpp.obj C:/Users/jaksk/Desktop/dev/_cpp/age/game/menu.cpp C:/Users/jaksk/Desktop/dev/_cpp/age/game/menu.h + C:/Users/jaksk/Desktop/dev/_cpp/age/game/tech.h C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.h CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h diff --git a/CMakeFiles/sdl_test.dir/depend.make b/CMakeFiles/sdl_test.dir/depend.make index 0a246e4..e197c59 100644 --- a/CMakeFiles/sdl_test.dir/depend.make +++ b/CMakeFiles/sdl_test.dir/depend.make @@ -85,6 +85,7 @@ CMakeFiles/sdl_test.dir/game/load.cpp.obj: umath/vec2.h CMakeFiles/sdl_test.dir/game/menu.cpp.obj: game/menu.cpp CMakeFiles/sdl_test.dir/game/menu.cpp.obj: game/menu.h +CMakeFiles/sdl_test.dir/game/menu.cpp.obj: game/tech.h CMakeFiles/sdl_test.dir/game/menu.cpp.obj: umath/vec2.h CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj: game/entity.h diff --git a/CMakeFiles/sdl_test.dir/game/ground.cpp.obj b/CMakeFiles/sdl_test.dir/game/ground.cpp.obj index a5b97a9..2426007 100644 Binary files a/CMakeFiles/sdl_test.dir/game/ground.cpp.obj and b/CMakeFiles/sdl_test.dir/game/ground.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/game/gst.cpp.obj b/CMakeFiles/sdl_test.dir/game/gst.cpp.obj index befdc3b..1ade445 100644 Binary files a/CMakeFiles/sdl_test.dir/game/gst.cpp.obj and b/CMakeFiles/sdl_test.dir/game/gst.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/game/load.cpp.obj b/CMakeFiles/sdl_test.dir/game/load.cpp.obj index 70cb174..5fee533 100644 Binary files a/CMakeFiles/sdl_test.dir/game/load.cpp.obj and b/CMakeFiles/sdl_test.dir/game/load.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/game/menu.cpp.obj b/CMakeFiles/sdl_test.dir/game/menu.cpp.obj index a7eb752..507e390 100644 Binary files a/CMakeFiles/sdl_test.dir/game/menu.cpp.obj and b/CMakeFiles/sdl_test.dir/game/menu.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj b/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj index 26f4ca2..7b273d0 100644 Binary files a/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj and b/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/game/view.cpp.obj b/CMakeFiles/sdl_test.dir/game/view.cpp.obj index b4bb2aa..5292e10 100644 Binary files a/CMakeFiles/sdl_test.dir/game/view.cpp.obj and b/CMakeFiles/sdl_test.dir/game/view.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj b/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj index edc51da..1823965 100644 Binary files a/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj and b/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/main.cpp.obj b/CMakeFiles/sdl_test.dir/main.cpp.obj index b59be06..902c25e 100644 Binary files a/CMakeFiles/sdl_test.dir/main.cpp.obj and b/CMakeFiles/sdl_test.dir/main.cpp.obj differ diff --git a/CMakeFiles/sdl_test.dir/objects.a b/CMakeFiles/sdl_test.dir/objects.a index 9fd1454..f1914f9 100644 Binary files a/CMakeFiles/sdl_test.dir/objects.a and b/CMakeFiles/sdl_test.dir/objects.a differ diff --git a/build/content/entities.json b/build/content/entities.json index fcfb92d..06026e6 100644 --- a/build/content/entities.json +++ b/build/content/entities.json @@ -1,7 +1,7 @@ [ { "name": "Town Center", - "id": 100, "unit": 0, "class": "bld", + "id": 100, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 600, "range": 0, "sight": 10, "spritebounds": [ 528, 16 ], @@ -10,7 +10,7 @@ "cost": [ 600, 400 ] },{ "name": "Mill", - "id": 101, "unit": 0, "class": "bld", + "id": 101, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 250, "range": 0, "sight": 7, "spritebounds": [ 544, 16 ], @@ -18,7 +18,7 @@ "cost": [ 120, 90 ] },{ "name": "Mine", - "id": 102, "unit": 0, "class": "bld", + "id": 102, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 560, 16 ], @@ -26,7 +26,7 @@ "cost": [ 360, 240 ] },{ "name": "Farm", - "id": 103, "unit": 0, "class": "bld", + "id": 103, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 150, "range": 0, "sight": 7, "spritebounds": [ 576, 16 ], @@ -35,7 +35,7 @@ "adjacent": [ 101 ] },{ "name": "Barracks", - "id": 104, "unit": 0, "class": "bld", + "id": 104, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 592, 16 ], @@ -45,7 +45,7 @@ "adjacent": [ 100 ] },{ "name": "Archery Range", - "id": 105, "unit": 0, "class": "bld", + "id": 105, "unit": 0, "class": "bld", "level": 1, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 608, 16 ], @@ -55,79 +55,149 @@ "adjacent": [ 100 ] },{ "name": "Blacksmith", - "id": 106, "unit": 0, "class": "bld", + "id": 106, "unit": 0, "class": "bld", "level": 1, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 624, 16 ], "prod": [ 0, 0 ], "cost": [ 285, 165 ], "adjacent": [ 100 ] + },{ + "name": "Market", + "id": 107, "unit": 0, "class": "bld", "level": 1, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 640, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "adjacent": [ 100 ] + },{ + "name": "Stable", + "id": 108, "unit": 0, "class": "bld", "level": 0, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 656, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "adjacent": [ 100 ] + },{ + "name": "Siege Workshop", + "id": 109, "unit": 0, "class": "bld", "level": 2, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 672, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "adjacent": [ 100 ] + },{ + "name": "Church", + "id": 110, "unit": 0, "class": "bld", "level": 2, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 688, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "adjacent": [ 100 ] + },{ + "name": "University", + "id": 111, "unit": 0, "class": "bld", "level": 2, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 704, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "adjacent": [ 100 ] + },{ + "name": "Tower", + "id": 112, "unit": 0, "class": "bld", "level": 2, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 720, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "diagonal": [ 100 ] + },{ + "name": "Castle", + "id": 113, "unit": 0, "class": "bld", "level": 2, + "move" : 0, "attack": 0, "defence": 300, + "range": 0, "sight": 7, + "spritebounds": [ 720, 16 ], + "prod": [ 0, 0 ], + "cost": [ 360, 240 ], + "diagonal": [ 100 ] },{ "name": "Villager", - "id": 0, "unit": 1, "class": "inf", + "id": 0, "unit": 1, "class": "inf", "level": -1, "move" : 7, "attack": 50, "defence": 50, "range": 1, "sight": 7, "spritebounds": [ 96, 16 ], "build": [ - 100, 101, 102, 103, 104, 105, 106 + 100, 101, 102, 103, 104, 105, 106, 107 ], "cost": [ 100, 100 ] },{ "name": "Militia", - "id": 1, "unit": 1, "class": "inf", + "id": 1, "unit": 1, "class": "inf", "level": 0, "move" : 7, "attack": 100, "defence": 100, "range": 1, "sight": 7, "spritebounds": [ 112, 16 ], - "cost": [ 75, 25 ] + "cost": [ 75, 25 ], + "upgrade": 6 },{ "name": "Scout Cavalry", - "id": 2, "unit": 1, "class": "cav", + "id": 2, "unit": 1, "class": "cav", "level": 0, "move" : 12, "attack": 100, "defence": 100, "range": 1, "sight": 7, "spritebounds": [ 128, 16 ], "cost": [ 100, 50 ], - "abilities": [ "Scout" ] + "abilities": [ "Scout" ], + "upgrade": 5 },{ "name": "Archers", - "id": 3, "unit": 1, "class": "ran", + "id": 3, "unit": 1, "class": "ran", "level": 1, "move" : 7, "attack": 150, "defence": 100, "range": 3, "sight": 7, "spritebounds": [ 160, 32 ], - "cost": [ 125, 50 ] + "cost": [ 125, 50 ], + "upgrade": 24 },{ "name": "Skirmishers", - "id": 4, "unit": 1, "class": "ran", + "id": 4, "unit": 1, "class": "ran", "level": 1, "move" : 7, "attack": 110, "defence": 110, "range": 2, "sight": 7, "spritebounds": [ 176, 32 ], "cost": [ 125, 50 ], - "abilities": [ "Skirmish" ] + "abilities": [ "Skirmish" ], + "upgrade": 14 },{ "name": "Light Cavalry", - "id": 5, "unit": 1, "class": "cav", + "id": 5, "unit": 1, "class": "cav", "level": 1, "move" : 10, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 128, 32 ], "cost": [ 125, 50 ], - "abilities": [ "Plains Charge" ] + "abilities": [ "Plains Charge" ], + "upgrade": 8 },{ "name": "Men at Arms", - "id": 6, "unit": 1, "class": "inf", + "id": 6, "unit": 1, "class": "inf", "level": 1, "move" : 7, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 112, 32 ], - "cost": [ 125, 50 ] + "cost": [ 125, 50 ], + "upgrade": 10 },{ "name": "Spearmen", - "id": 7, "unit": 1, "class": "inf", + "id": 7, "unit": 1, "class": "inf", "level": 1, "move" : 7, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 144, 32 ], "cost": [ 125, 50 ], - "abilities": [ "Anti-Cavalry" ] + "abilities": [ "Anti-Cavalry" ], + "upgrade": 11 },{ "name": "Knight", - "id": 8, "unit": 1, "class": "cav", + "id": 8, "unit": 1, "class": "cav", "level": 2, "move" : 10, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 128, 48 ], @@ -135,7 +205,7 @@ "abilities": [ "Plains Charge" ] },{ "name": "Camels", - "id": 9, "unit": 1, "class": "cav", + "id": 9, "unit": 1, "class": "cav", "level": 2, "move" : 10, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 192, 48 ], @@ -143,14 +213,14 @@ "abilities": [ "Desert Charge", "Scares Horses" ] },{ "name": "Longswordmen", - "id": 10, "unit": 1, "class": "inf", + "id": 10, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 112, 48 ], "cost": [ 125, 50 ] },{ "name": "Pikemen", - "id": 11, "unit": 1, "class": "inf", + "id": 11, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 150, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 144, 48 ], @@ -158,7 +228,7 @@ "abilities": [ "Anti-Cavalry" ] },{ "name": "Viking Berserkers", - "id": 12, "unit": 1, "class": "inf", + "id": 12, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 208, 48 ], @@ -166,7 +236,7 @@ "abilities": [ "Frenzy" ] },{ "name": "Crossbowmen", - "id": 13, "unit": 1, "class": "ran", + "id": 13, "unit": 1, "class": "ran", "level": 2, "move" : 7, "attack": 200, "defence": 175, "range": 3, "sight": 7, "spritebounds": [ 224, 48 ], @@ -174,7 +244,7 @@ "abilities": [ "No Move & Attack" ] },{ "name": "Elite Skirmishers", - "id": 14, "unit": 1, "class": "ran", + "id": 14, "unit": 1, "class": "ran", "level": 2, "move" : 7, "attack": 150, "defence": 150, "range": 2, "sight": 7, "spritebounds": [ 176, 48 ], @@ -182,14 +252,14 @@ "abilities": [ "Skirmish" ] },{ "name": "Horse Archers", - "id": 15, "unit": 1, "class": "ran", + "id": 15, "unit": 1, "class": "ran", "level": 2, "move" : 10, "attack": 150, "defence": 150, "range": 2, "sight": 7, "spritebounds": [ 240, 48 ], "cost": [ 125, 50 ] },{ "name": "Throwing Axmen", - "id": 16, "unit": 1, "class": "inf", + "id": 16, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 225, "defence": 250, "range": 1, "sight": 7, "spritebounds": [ 256, 48 ], @@ -197,7 +267,7 @@ "abilities": [ "Skirmish", "Woodsman" ] },{ "name": "Persian War Elephants", - "id": 17, "unit": 1, "class": "cav", + "id": 17, "unit": 1, "class": "cav", "level": 2, "move" : 7, "attack": 200, "defence": 250, "range": 1, "sight": 7, "spritebounds": [ 272, 48 ], @@ -205,7 +275,7 @@ "abilities": [ "Causes Fear" ] },{ "name": "Celtic Woad Raiders", - "id": 18, "unit": 1, "class": "inf", + "id": 18, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 288, 48 ], @@ -213,7 +283,7 @@ "abilities": [ "Causes Fear" ] },{ "name": "Knights Templar", - "id": 19, "unit": 1, "class": "cav", + "id": 19, "unit": 1, "class": "cav", "level": 2, "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 304, 48 ], @@ -221,7 +291,7 @@ "abilities": [ "Plains Charge", "Zeal" ] },{ "name": "Scorpions", - "id": 20, "unit": 1, "class": "sie", + "id": 20, "unit": 1, "class": "sie", "level": 2, "move" : 7, "attack": 350, "defence": 250, "range": 3, "sight": 7, "spritebounds": [ 320, 48 ], @@ -229,7 +299,7 @@ "abilities": [ "Units Only", "No Counter", "No Move & Attack" ] },{ "name": "Battering Rams", - "id": 21, "unit": 1, "class": "sie", + "id": 21, "unit": 1, "class": "sie", "level": 2, "move" : 7, "attack": 400, "defence": 325, "range": 1, "sight": 7, "spritebounds": [ 336, 48 ], @@ -237,7 +307,7 @@ "abilities": [ "Buildings Only", "No Counter" ] },{ "name": "Onagers", - "id": 22, "unit": 1, "class": "sie", + "id": 22, "unit": 1, "class": "sie", "level": 2, "move" : 7, "attack": 275, "defence": 275, "range": 1, "sight": 7, "spritebounds": [ 352, 48 ], @@ -245,11 +315,18 @@ "abilities": [ "No Move & Attack", "No Counter" ] },{ "name": "Monks", - "id": 23, "unit": 1, "class": "inf", + "id": 23, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 50, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 368, 48 ], "cost": [ 125, 50 ], "abilities": [ "Heal", "Convert" ] + },{ + "name": "Archers", + "id": 24, "unit": 1, "class": "ran", "level": 2, + "move" : 7, "attack": 150, "defence": 100, + "range": 3, "sight": 7, + "spritebounds": [ 160, 32 ], + "cost": [ 125, 50 ] } ] \ No newline at end of file diff --git a/build/content/gf.bmp b/build/content/gf.bmp index dbe9758..9450576 100644 Binary files a/build/content/gf.bmp and b/build/content/gf.bmp differ diff --git a/build/content/sprites.bmp b/build/content/sprites.bmp index 2696bb5..0cb4039 100644 Binary files a/build/content/sprites.bmp and b/build/content/sprites.bmp differ diff --git a/build/content/techs.json b/build/content/techs.json index f724969..df2ac8d 100644 --- a/build/content/techs.json +++ b/build/content/techs.json @@ -1,304 +1,398 @@ [ { - "name": "Loom", - "cost": [ 50, 150 ] - "" + "name": "Loom", "id": 0, "level": 0, + "cost": [ 50, 150 ], "req_id": 100, + "bonus": { + "aff_id": [ 0 ], + "defence": 0.25 + } + },{ + "name": "Town Scouts", "id": 1, "level": 0, + "cost": [ 50, 150 ], "req_id": 100, + "bonus": { + "aff_id": [ 100 ], + "sight": 4 + } + },{ + "name": "Leather Soles", "id": 2, "level": 0, + "cost": [ 50, 150 ], "req_id": 100, + "bonus": { + "aff_id": [ 0 ], + "move": 1 + } + },{ + "name": "Weaponsmith", "id": 3, "level": 0, + "cost": [ 50, 150 ], "req_id": 104, + "bonus": { + "aff_id": [ 1 ], + "attack": 0.25 + } + },{ + "name": "Town Watch", "id": 4, "level": 1, + "cost": [ 95, 280 ], "req_id": 100, + "bonus": { + "aff_id": [ 100 ], + "defence": 0.2, "sight": 2 + } + },{ + "name": "Wheelbarrow", "id": 5, "level": 1, + "cost": [ 125, 375 ], "req_id": 100, + "bonus": { + "aff_class": [ "bld" ], + "cost": [ -0.1, -0.1 ] + } + },{ + "name": "Advanced Mining", "id": 6, "level": 1, + "cost": [ 95, 280 ], "req_id": 102, + "bonus": { + "aff_id": [ 102 ], + "prod": [ 0, 0.15 ] + } + },{ + "name": "Horse Collar", "id": 7, "level": 1, + "cost": [ 95, 280 ], "req_id": 101, + "bonus": { + "prod": [ 0.15, 0 ] + } + },{ + "name": "Scale Mail Armor", "id": 8, "level": 1, + "cost": [ 95, 280 ], "req_id": 106, + "bonus": { + "aff_class": [ "inf" ], + "aff_level": 1, + "defence": 0.25 + } + },{ + "name": "Scale Barding", "id": 9, "level": 1, + "cost": [ 95, 280 ], "req_id": 106, + "bonus": { + "aff_class": [ "cav" ], + "aff_level": 1, + "defence": 0.25 + } + },{ + "name": "Fletching", "id": 10, "level": 1, + "cost": [ 95, 280 ], "req_id": 106, + "bonus": { + "aff_class": [ "ran" ], + "aff_level": 1, + "attack": 0.25 + } + },{ + "name": "Padded Armor", "id": 11, "level": 1, + "cost": [ 95, 280 ], "req_id": 106, + "bonus": { + "aff_class": [ "ran" ], + "aff_level": 1, + "defence": 0.25 + } + },{ + "name": "Forging", "id": 12, "level": 1, + "cost": [ 155, 470 ], "req_id": 106, + "bonus": { + "aff_class": [ "inf", "cav" ], + "aff_level": 1, + "attack": 0.25 + } + },{ + "name": "Tracking", "id": 13, "level": 1, + "cost": [ 95, 280 ], "req_id": 104, + "bonus": { + "aff_class": [ "inf" ], + "sight": 2 + } + },{ + "name": "Cartography", "id": 14, "level": 1, + "cost": [ 95, 280 ], "req_id": 107, + "bonus": { + "sight": 1 + } + },{ + "name": "Trading", "id": 15, "level": 1, + "cost": [ 95, 280 ], "req_id": 107, + "bonus": { + "trade": 1 + } + },{ + "name": "Coniage", "id": 16, "level": 1, + "cost": [ 125, 375 ], "req_id": 107, + "bonus": { + "prod": [ 0, 0.1 ] + } + },{ + "name": "Town Patrol", "id": 17, "level": 2, + "cost": [ 150, 450 ], "req_id": 100, + "bonus": { + "aff_id": [ 100 ], + "defence": 0.2, "sight": 2 + } + },{ + "name": "Hand Cart", "id": 18, "level": 2, + "cost": [ 150, 450 ], "req_id": 100, + "bonus": { + "aff_class": [ "bld" ], + "cost": [ -0.1, -0.1 ] + } + },{ + "name": "Shaft Mining", "id": 19, "level": 2, + "cost": [ 150, 450 ], "req_id": 102, + "bonus": { + "aff_id": [ 102 ], + "prod": [ 0, 0.15 ] + } + },{ + "name": "Heavy Plow", "id": 20, "level": 2, + "cost": [ 150, 450 ], "req_id": 101, + "bonus": { + "prod": [ 0.1, 0 ] + } + },{ + "name": "Chain Mail Armor", "id": 21, "level": 2, + "cost": [ 150, 450 ], "req_id": 106, + "bonus": { + "aff_level": 2, + "aff_class": [ "inf" ], + "defence": 0.25 + } + },{ + "name": "Chain Barding", "id": 22, "level": 2, + "cost": [ 150, 450 ], "req_id": 106, + "bonus": { + "aff_level": 2, + "aff_class": [ "cav" ], + "defence": 0.25 + } + },{ + "name": "Bodkin Arrow", "id": 23, "level": 2, + "cost": [ 150, 450 ], "req_id": 106, + "bonus": { + "aff_level": 2, + "aff_class": [ "ran" ], + "attack": 0.25 + } + },{ + "name": "Leather Armor", "id": 24, "level": 2, + "cost": [ 150, 450 ], "req_id": 106, + "bonus": { + "aff_level": 2, + "aff_class": [ "ran" ], + "defence": 0.25 + } + },{ + "name": "Iron Casting", "id": 25, "level": 2, + "cost": [ 250, 750 ], "req_id": 106, + "bonus": { + "aff_level": 2, + "aff_class": [ "inf", "cav" ], + "attack": 0.25 + } + },{ + "name": "Conscription", "id": 26, "level": 2, + "cost": [ 150, 450 ], "req_id": 104, + "bonus": { + "aff_class": [ "inf" ], + "cost_abs": [ -15, -15 ] + } + },{ + "name": "Husbandry", "id": 27, "level": 2, + "cost": [ 150, 450 ], "req_id": 108, + "bonus": { + "aff_class": [ "cav" ], + "cost_abs": [ -15, -15 ] + } + },{ + "name": "Tournaments", "id": 28, "level": 2, + "cost": [ 150, 450 ], "req_id": 105, + "bonus": { + "aff_class": [ "ran" ], + "cost_abs": [ -15, -15 ] + } + },{ + "name": "Mechanics Guild", "id": 29, "level": 2, + "cost": [ 150, 450 ], "req_id": 109, + "bonus": { + "aff_class": [ "sie" ], + "cost_abs": [ -15, -15 ] + } + },{ + "name": "Banking", "id": 30, "level": 2, + "cost": [ 200, 600 ], "req_id": 107, + "bonus": { + "trade": 1, + "prod": [ 0, 0.05 ] + } + },{ + "name": "Merchant Network", "id": 31, "level": 2, + "cost": [ 150, 450 ], "req_id": 107, + "bonus": { + "aff_mercs": 1, + "cost_abs": [ 0, -25 ] + } + },{ + "name": "Redemption", "id": 32, "level": 2, + "cost": [ 150, 450 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "improved_heal": 1 + } + },{ + "name": "Fervor", "id": 33, "level": 2, + "cost": [ 150, 450 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "improved_convert": 1 + } + },{ + "name": "Sanctity", "id": 34, "level": 2, + "cost": [ 150, 450 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "defence": 0.25 + } + },{ + "name": "Murder Holes", "id": 35, "level": 2, + "cost": [ 95, 280 ], "req_id": 111, + "bonus": { + "aff_id": [ 112 ], + "defence": 0.25 + } + },{ + "name": "Masonry", "id": 36, "level": 2, + "cost": [ 95, 280 ], "req_id": 111, + "bonus": { + "aff_class": [ "bld" ], + "defence": 0.05 + } + },{ + "name": "Crop Rotation", "id": 37, "level": 3, + "cost": [ 250, 750 ], "req_id": 101, + "bonus": { + "prod": [ 0.1, 0 ] + } + },{ + "name": "Plate Mail", "id": 38, "level": 3, + "cost": [ 250, 750 ], "req_id": 106, + "bonus": { + "aff_level": 3, + "aff_class": [ "inf" ], + "defence": 0.25 + } + },{ + "name": "Plate Barding", "id": 39, "level": 3, + "cost": [ 250, 750 ], "req_id": 106, + "bonus": { + "aff_level": 3, + "aff_class": [ "cav" ], + "defence": 0.25 + } + },{ + "name": "Bracers", "id": 40, "level": 3, + "cost": [ 250, 750 ], "req_id": 106, + "bonus": { + "aff_level": 3, + "aff_class": [ "ran" ], + "attack": 0.25 + } + },{ + "name": "Ring Archer Armor", "id": 41, "level": 3, + "cost": [ 250, 750 ], "req_id": 106, + "bonus": { + "aff_level": 3, + "aff_class": [ "ran" ], + "defence": 0.25 + } + },{ + "name": "Blast Furnace", "id": 42, "level": 3, + "cost": [ 625, 975 ], "req_id": 106, + "bonus": { + "aff_level": 3, + "aff_class": [ "inf", "cav" ], + "attack": 0.25 + } + },{ + "name": "Arena", "id": 43, "level": 3, + "cost": [ 250, 750 ], "req_id": 104 + },{ + "name": "Squires", "id": 44, "level": 3, + "cost": [ 250, 750 ], "req_id": 108 + },{ + "name": "Flaming Arrows", "id": 45, "level": 3, + "cost": [ 300, 900 ], "req_id": 105 + },{ + "name": "Sappers", "id": 46, "level": 3, + "cost": [ 300, 900 ], "req_id": 113 + },{ + "name": "Hoardings", "id": 47, "level": 3, + "cost": [ 250, 750 ], "req_id": 113, + "bonus": { + "aff_id": [ 113 ], + "defence": 0.35 + } + },{ + "name": "Spies", "id": 48, "level": 3, + "cost": [ 300, 900 ], "req_id": 113 + },{ + "name": "Guilds", "id": 49, "level": 3, + "cost": [ 250, 750 ], "req_id": 107, + "bonus": { + "trade": 1, + "prod": [ 0, 0.05 ] + } + },{ + "name": "Atonement", "id": 50, "level": 3, + "cost": [ 250, 750 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "improved_heal": 1 + } + },{ + "name": "Block Printing", "id": 51, "level": 3, + "cost": [ 250, 750 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "improved_convert": 1 + } + },{ + "name": "Illumination", "id": 52, "level": 3, + "cost": [ 250, 750 ], "req_id": 110, + "bonus": { + "aff_id": [ 110 ], + "prod": [ 0, 0.5 ] + } + },{ + "name": "Faith", "id": 53, "level": 3, + "cost": [ 250, 750 ], "req_id": 110, + "bonus": { + "aff_id": [ 23 ], + "defence": 0.25 + } + },{ + "name": "Treadmill Crane", "id": 54, "level": 3, + "cost": [ 250, 750 ], "req_id": 111, + "bonus": { + "aff_class": [ "bld" ], + "cost": [ 0.1, 0.1 ] + } + },{ + "name": "Siege Engineers", "id": 55, "level": 3, + "cost": [ 250, 750 ], "req_id": 111 + },{ + "name": "Architecture", "id": 56, "level": 3, + "cost": [ 250, 750 ], "req_id": 111, + "bonus": { + "aff_class": [ "bld" ], + "defence": 0.05 + } + },{ + "name": "Chemistry", "id": 57, "level": 3, + "cost": [ 250, 750 ], "req_id": 111 + },{ + "name": "Ballistics", "id": 58, "level": 3, + "cost": [ 300, 900 ], "req_id": 111, + "bonus": { + "aff_class": [ "sie" ], + "req_range": 1, + "attack": 0.25 + } } -] -* Loom -Requires: Town Center -Cost: 50f 150g -All Villagers get +25 DEF - -* Town Scouts -Requires: Town Center -Cost: 50f 150g -Town Centers gain +4 Sight - -* Leather Soles -Prereqs: Town Center -Cost: 50f 150g -Villagers gain +1 Move - -* Weaponsmith -Requires: Barracks -Cost: 50f 150g -Militia gain +25 ATT - -============ --Feudal Age: -============ - -* Town Watch -Requires: Town Center -Cost: 95f 280g -Improves Town Center DEF by +20% and Sight by +2 - -* Wheelbarrow -Requires: Town Center -Cost: 125f 375g -Cost of buildings is reduced by 10% - -* Advanced Mining -Requires: Mine -Cost: 95f 280g -+15% to Mine income - -* Horse Collar -Requires: Mill -Cost: 95f 280g -+15% to food income - -* Scale Mail Armor -Requires: Blacksmith -Cost: 95f 280g -+25% DEF for Infantry - -* Scale Barding -Requires: Blacksmith -Cost: 95f 280g -+25% DEF for Cavalry - -* Fletching -Requires: Blacksmith -Cost: 95f 280g -+25% ATT for Ranged Units - -* Padded Armor -Requires: Blacksmith -Cost: 95f 280g -+25% DEF for Ranged Units - -* Forging -Requires: Blacksmith -Cost: 155f 470g -+25% ATT for Infantry and Cavalry - -* Tracking -Requires: Barracks -Cost: 95f 280g -+2 Sight for Infantry - -* Cartography -Requires: Market -Cost: 95f 280g -+1 Sight for all units - -++++++++++++ --Castle Age: -++++++++++++ - -* Town Patrol -Requires: Town Center -Cost: 150f 450g -+2 Sight and +20% DEF for Town Center - -* Hand Cart -Requires: Town Center -Cost: 150f 450g -Cost of Building is reduced by 10% - -* Shaft Mining -Requires: Mine -Cost: 150f 450g -+15% to Mine income - -* Heavy Plow -Requires: Mill -Cost: 150f 450g -+15% to food income - -* Chain Mail Armor -Requires: Blacksmith -Cost: 150f 450g -+25% DEF to Age 3 infantry - -* Chain Barding -Requires: Blacksmith -Cost: 150f 450g -+25% DEF to Age 3 Cavalry - -* Bodkin Arrow -Requires: Blacksmith -Cost: 150f 450g -+25% ATT to Age 3 Ranged Units - -* Leather Armor -Requires: Blacksmith -Cost: 150f 450g -+25% DEF to Age 3 Ranged Units - -* Iron Casting -Requires: Blacksmith -Cost: 250f 750g -+25% ATT to Age 3 Infantry and Cavalry - -* Conscription -Requires: Barracks -Cost: 150f 450g -Cost of Infantry is reduced by 15 food and 15 gold - -* Husbandry -Requires: Stable -Cost: 150f 450g -Cost of Cavalry is reduced by 15 food and 15 gold - -* Archery Tournaments -Requires: Archery Range -Cost: 150f 450g -Cost of Ranged Units is reduced by 15 food and 15 gold - -* Mechanics Guild -Requires: Siege Workshop -Cost: 150f 450g -Cost of Siege Units is reduced by 15 food and 15 gold - -* Banking -Requires: Market -Cost: 200f 600g -+ 5% gold Income and improved Trade Rate - -* Merchant Network -Requires: Market -Cost: 150f 450g -Price for Mercenaries is reduced by 25% - -* Redemption -Requires: Church -Cost: 150f 450g -Improves Heal ability of Monks and Elite Monks - -* Fervor -Requires: Church -Cost: 150f 450g -Improves Convert ability of Monks and Elite Monks - -* Sanctity -Requires: Church -Cost: 150f 450g -+25% DEF for Monks and Elite Monks - -* Murder Holes -Requires: University -Cost: 95f 280g -+25% DEF for Towers - -* Masonry -Requires: University -Cost: 150f 450g -+5% DEF for all buildings - -///////////// -Imperial Age: -\\\\\\\\\\\\\ - - -* Crop Rotation -Requires: Mill -Cost: 250f 750g -+10% to food income - -* Plate Mail Armor -Requires: Blacksmith -Cost: 250f 750g -Age 4 Infantry units gain +25% DEF - -* Plate Barding -Requires: Blacksmith -Cost: 250f 750g -Age 4 Cavalry units gain +25% DEF - -* Bracers -Requires: Blacksmith -Cost: 250f 750g -Age 4 Ranged units gain +25% ATK - -* Ring Archer Armor -Requires: Blacksmith -Cost: 250f 750g -Age 4 Ranged units gain +25% DEF - -* Blast Furnace -Requires: Blacksmith -Cost: 625f 975g -Age 4 INF and CAV units gain +25% ATK - -* Arena -Requires: Barracks -Cost: 250f 750g -Allows Champions - -* Squires -Requires: Stables -Cost: 250f 750g -Allows Paladins - -* Flaming Arrows -Requires: Archery Range -Cost: 300f 900g -RNG units no longer suffer penalty vs. BLDGS - -* Sappers -Requires: Castle -Cost: 300f 900g -All INF units improve in +50% ATK vs. buildings - -* Hoardings -Requires: Castle -Cost: 250f 750g -Improves Castle DEF by +35% - -* Spies -Requires: Castles -Cost: 300f 900g -All enemy Town Complexes are now sighted - -* Guilds -Requires: Market -Cost: 300f 900g -+5% gold income and improves Trade rate - -* Atonement -Requires: Church -Cost: 250f 750g -Improves Heal ability of Monks or Elite Monks - -* Block Printing -Requires: Church -Cost: 250f 750g -Improves Convert ability of Monks or Elite Monks - -* Illumination -Requires: Church -Cost: 250f 750g -+505 gold income from all relics - -* Faith -Requires: Church -Cost: 250f 750g -Monks and Elite Monks gain +25% DEF - -* Treadmill Crane -Requires: University -Cost: 250f 750g -Cost of buildings is reduced by 10% - -* Siege Engineers -Requires: University -Cost: 250f 750g -Allows Imperial Age Siege units to be built - -* Architecture -Requires: University -Cost: 250f 750g -+5% DEF for all buildings - -* Chemistry -Requires: University -Cost: 250f 750g -Allows Hand Cannondeers and Bombard Cannons - -* Ballistics -Requires: University -Cost: 300f 900g -+25% ATK for Siege units with Range above 1 \ No newline at end of file +] \ No newline at end of file diff --git a/build/content/tiles.json b/build/content/tiles.json index bb34075..40373ed 100644 --- a/build/content/tiles.json +++ b/build/content/tiles.json @@ -4,7 +4,7 @@ "move_cost": 2, "sight_cost": 2, "range_bonus": 0, - "defence_bonus": 0.2, + "defence_bonus": 0.0, "spritebounds": [ 0, 16 ] },{ "name": "Mountain", diff --git a/build/sdl_test.exe b/build/sdl_test.exe index 6d3f0c7..12fa827 100644 Binary files a/build/sdl_test.exe and b/build/sdl_test.exe differ diff --git a/game/entity.h b/game/entity.h index 36c8198..eeab110 100644 --- a/game/entity.h +++ b/game/entity.h @@ -49,7 +49,7 @@ class Entity { return x == oth.x && y == oth.y && info->unit == oth.info->unit; } - int building = 0; + int building { 0 }; float hp; /**/ int x, y; bool done = false; diff --git a/game/ground.cpp b/game/ground.cpp index 0ea273d..e6055bf 100644 --- a/game/ground.cpp +++ b/game/ground.cpp @@ -88,9 +88,7 @@ std::vector Ground::move_area (Gst &gst, Entity &ent) { std::vector Ground::attack_targets (Gst &gst, Entity &ent) { std::vector attacks; - int range = ent.info->range; - range += gst.tiles[gst.ground.tiles[gst.ground.at(ent.x, ent.y)]] - .range_bonus; + int range = gst.get_range(ent); bool builds = !gst.info_has_ability(ent.info, "Units Only"); bool units = !gst.info_has_ability(ent.info, "Buildings Only"); for (Entity &e : gst.entities) { diff --git a/game/gst.cpp b/game/gst.cpp index f6d5aa1..0a524fc 100644 --- a/game/gst.cpp +++ b/game/gst.cpp @@ -28,25 +28,25 @@ Entity& Gst::get_at (int x, int y) { } float Gst::get_type_bonus (Entity &atk, Entity &def) { - float b = 1; + float b = 0; switch(atk.info->ent_class) { case EntityInfo::Class::inf: - if (def.info->ent_class == EntityInfo::Class::bld) b += 1.0/3; - if (def.info->ent_class == EntityInfo::Class::sie) b += 1.0/3; + if (def.info->ent_class == EntityInfo::Class::bld) b += 1.0f/3.0f; + if (def.info->ent_class == EntityInfo::Class::sie) b += 1.0f/3.0f; break; case EntityInfo::Class::cav: if (def.info->ent_class == EntityInfo::Class::bld) b += -0.5; - if (def.info->ent_class == EntityInfo::Class::inf) b += 1.0/3; - if (def.info->ent_class == EntityInfo::Class::ran) b += 1.0/3; + if (def.info->ent_class == EntityInfo::Class::inf) b += 1.0f/3.0f; + if (def.info->ent_class == EntityInfo::Class::ran) b += 1.0f/3.0f; break; case EntityInfo::Class::ran: - if (def.info->ent_class == EntityInfo::Class::bld) b += -0.5; + if (def.info->ent_class == EntityInfo::Class::bld) b += -0.5f; break; case EntityInfo::Class::sie: - if (def.info->ent_class == EntityInfo::Class::bld) b += +0.5; + if (def.info->ent_class == EntityInfo::Class::bld) b += +0.5f; break; } return b; @@ -54,15 +54,24 @@ float Gst::get_type_bonus (Entity &atk, Entity &def) { std::vector Gst::get_bonuses (Entity &atk, Entity &def) { std::vector bs; - bs.emplace_back( - tiles[ground.tiles[ground.at(atk.x, atk.y)]].attack_bonus, - Bonus::Id::ground, true); - bs.emplace_back( - tiles[ground.tiles[ground.at(def.x, def.y)]].defence_bonus, - Bonus::Id::ground, false); + if (tiles[ground.tiles[ground.at(atk.x, atk.y)]].attack_bonus != 0) { - bs.emplace_back(get_type_bonus(atk, def), Bonus::Id::type, true); - bs.emplace_back(get_type_bonus(def, atk), Bonus::Id::type, false); + bs.emplace_back( + tiles[ground.tiles[ground.at(atk.x, atk.y)]].attack_bonus, + Bonus::Id::ground, true); + } + if (tiles[ground.tiles[ground.at(def.x, def.y)]].defence_bonus != 0) { + bs.emplace_back( + tiles[ground.tiles[ground.at(def.x, def.y)]].defence_bonus, + Bonus::Id::ground, false); + } + + if (get_type_bonus(atk, def) != 0) { + bs.emplace_back(get_type_bonus(atk, def), Bonus::Id::type, true); + } + if (get_type_bonus(def, atk) != 0) { + bs.emplace_back(get_type_bonus(def, atk), Bonus::Id::type, false); + } if (info_has_ability(atk.info, "Causes Fear")) bs.emplace_back(-1.0f/3, Bonus::Id::ability, false); @@ -95,11 +104,10 @@ std::vector Gst::get_bonuses (Entity &atk, Entity &def) { if (info_has_ability(atk.info, "Frenzy")) bs.emplace_back(1/atk.hp, Bonus::Id::ability, true); - return bs; } -float Gst::get_damage (Entity &atk, Entity &def) { +float Gst::get_damage (Entity &atk, Entity &def, float atk_hp) { float atkmul = 1; float defmul = 1; @@ -109,24 +117,30 @@ float Gst::get_damage (Entity &atk, Entity &def) { else { defmul += bonus.amt; } } - float dam = (atk.info->attack * atk.hp * atkmul) + float dam = (atk.info->attack * atk_hp * atkmul) / (2.0f*def.info->defence * defmul); return dam; } +float Gst::get_damage (Entity &atk, Entity &def) { + return get_damage(atk, def, atk.hp); +} + bool Gst::get_first_strike (Entity &atk, Entity &def) { bool fs { false }; fs = info_has_ability(atk.info, "First Strike"); return fs; } -float clamp (float hp) { if (hp > 100) hp = 100; return hp; } +float clamp (float hp) { + if (hp > 100) hp = 100; + if (hp < 0) hp = 0; + return hp; +} -void Gst::battle (Entity &atk, Entity &def) { - std::cout << "! attack " << atk.info->name << "(hp:" << atk.hp << "), " - << def.info->name << "(hp:" << def.hp << ") \n"; - +BattleResult Gst::battle_res (Entity &atk, Entity &def) { + BattleResult result { atk.hp, def.hp }; bool first_strike_atk = info_has_ability(atk.info, "First Strike"); bool first_strike_def = info_has_ability(def.info, "First Strike"); bool skirmish_atk = info_has_ability(atk.info, "Skirmish"); @@ -142,30 +156,54 @@ void Gst::battle (Entity &atk, Entity &def) { first_strike_def = first_strike_def || (anticav_def && atk.info->ent_class == EntityInfo::Class::cav); + int dist = abs(atk.x-def.x) + abs(atk.y-def.y); + bool def_inrange = (dist <= get_range(def)) ? true : false; + bool swap = false; if (first_strike_def && !first_strike_atk) swap = true; if (swap) { - atk.hp = clamp(atk.hp - get_damage(def, atk)); + if (def_inrange) { + result.atk_hp = clamp( + result.atk_hp - get_damage(def, atk, result.def_hp)); + } if (!info_has_ability(atk.info, "No Counter")) - if (atk.hp > 0) def.hp -= get_damage(atk, def); + if (result.atk_hp > 0) + result.def_hp = clamp( + result.def_hp - get_damage(atk, def, result.atk_hp)); } else { - def.hp = clamp(def.hp - get_damage(atk, def)); - if (!info_has_ability(def.info, "No Counter")) - if (def.hp > 0) atk.hp -= get_damage(def, atk); + result.def_hp = clamp( + result.def_hp - get_damage(atk, def, result.atk_hp)); + if (!info_has_ability(def.info, "No Counter") && def_inrange) + if (result.def_hp > 0) + result.atk_hp = clamp( + result.atk_hp - get_damage(def, atk, result.def_hp)); } if (info_has_ability(atk.info, "Rapid Fire")) - if (def.hp > 0) - def.hp = clamp(def.hp - get_damage(atk, def)); + if (result.def_hp > 0) + result.def_hp = clamp( + result.def_hp - get_damage(atk, def, result.def_hp)); + + if (info_has_ability(def.info, "Rapid Fire") && def_inrange) + if (result.atk_hp > 0) + result.atk_hp = clamp( + result.atk_hp - get_damage(def, atk, result.def_hp)); - if (info_has_ability(def.info, "Rapid Fire")) - if (atk.hp > 0) - atk.hp = clamp(atk.hp - get_damage(def, atk)); + if (result.atk_hp > 0 && info_has_ability(atk.info, "Zeal")) + result.atk_hp = clamp(result.atk_hp + 20); + if (result.def_hp > 0 && info_has_ability(def.info, "Zeal")) + result.def_hp = clamp(result.def_hp + 20); + + return result; +} + +void Gst::battle (Entity &atk, Entity &def) { + std::cout << "! attack " << atk.info->name << "(hp:" << atk.hp << "), " + << def.info->name << "(hp:" << def.hp << ") \n"; - if (atk.hp > 0 && info_has_ability(atk.info, "Zeal")) - atk.hp = clamp(atk.hp + 20); - if (def.hp > 0 && info_has_ability(def.info, "Zeal")) - def.hp = clamp(def.hp + 20); + auto result = battle_res(atk, def); + atk.hp = result.atk_hp; + def.hp = result.def_hp; std::cout << "! result " << atk.info->name << "(hp:" << atk.hp << "), " << def.info->name << "(hp:" << def.hp << ") \n"; @@ -182,6 +220,15 @@ void Gst::clear_dead() { } } +int Gst::get_range (Entity &ent) { + int range = ent.info->range; + if (range > 1) { + range += tiles[ground.tiles[ground.at(ent.x, ent.y)]].range_bonus; + } + if (range < 1) range = 1; + return range; +} + std::vector Gst::get_possible_builds (Entity &ent) { std::vector builds; for (int id : ent.info->build) { @@ -196,7 +243,7 @@ bool Gst::check_req_build(Entity &ent, EntityInfo *info) { for (int id : info->adjacent) { bool adj = false; for (Entity &e : entities) { - if (e.info->id == id) { + if (e.info->id == id && ent.owner == e.owner) { int dist = abs(e.x-ent.x) + abs(e.y-ent.y); if (dist == 1) { adj = true; @@ -213,7 +260,7 @@ bool Gst::check_req_build(Entity &ent, EntityInfo *info) { } int mindist = 9999; for (Entity &e : entities) { - if (e.info->id == 100) { + if (e.info->id == 100 && ent.owner == e.owner) { int dist = abs(e.x-ent.x) + abs(ent.y-e.y); if (dist < mindist) { mindist = dist; @@ -260,4 +307,21 @@ void Gst::end_day () { turn = 0; day++; } + for (Entity &e : entities) { + e.done = false; + e.moved = 0; + if (e.owner == turn) { + Player &player = players[e.owner]; + for (int i=0; iprod[i]; + } + // todo heal when on top of building + if (e.building < 0) { + e.building++; + if (e.building == 0) { + e.hp += 50; if (e.hp > 100) e.hp = 100; + } + } + } + } } \ No newline at end of file diff --git a/game/gst.h b/game/gst.h index ef6929a..906b372 100644 --- a/game/gst.h +++ b/game/gst.h @@ -24,6 +24,21 @@ class Bonus { Bonus(float amt, int id, bool atk) : amt(amt), id(id), atk(atk) {} float amt; int id; bool atk; enum Id { ground, type, ability, tech }; + std::string id_string () { + switch (id) { + case ground: return "Ground"; + case type: return "Class"; + case ability: return "Ability"; + case tech: return "Tech"; + } + } +}; + +class BattleResult { + public: + BattleResult(float atk_hp, float def_hp) + : atk_hp(atk_hp), def_hp(def_hp) {} + float atk_hp, def_hp; }; class Gst { @@ -47,9 +62,12 @@ class Gst { float get_type_bonus (Entity &atk, Entity &def); std::vector get_bonuses (Entity &atk, Entity &def); float get_damage (Entity &atk, Entity &def); + float get_damage (Entity &atk, Entity &def, float atk_hp); bool get_first_strike (Entity &atk, Entity &def); + BattleResult battle_res (Entity &atk, Entity &def); void battle (Entity &atk, Entity &def); void clear_dead(); + int get_range(Entity &ent); std::vector get_possible_builds (Entity &ent); diff --git a/game/load.cpp b/game/load.cpp index d1a1722..5baae6c 100644 --- a/game/load.cpp +++ b/game/load.cpp @@ -41,6 +41,8 @@ void load_json (Gst &gst) { Tile tile; tile.name = it["name"]; tile.move_cost = it["move_cost"]; + tile.defence_bonus = it["defence_bonus"]; + tile.range_bonus = it["range_bonus"]; tile.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; gst.tiles.push_back(tile); } @@ -88,4 +90,18 @@ void load_json (Gst &gst) { ent.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; gst.infos.push_back(ent); } + + std::ifstream file_techs("content/techs.json"); + json j_techs; file_techs >> j_techs; + for (auto it : j_techs) { + Tech tech; + tech.name = it["name"]; + tech.id = it["id"]; + tech.level = it["level"]; + tech.req_id = it["req_id"]; + for (int i=0; i + #include "menu.h" void Menu::close () { @@ -5,6 +7,7 @@ void Menu::close () { } void Menu::open (vec2 res) { + over = -1; active = true; pos = vec2 { (float)res.x, (float)res.y }; float height = options.size() * 20; @@ -26,4 +29,49 @@ int Menu::mouse_option (vec2 mouse) { i++; } return -1; +} + + +void Menu_tech::open (vec2 res) { + over = -1; + active = true; + pos = vec2 { (float)res.x, (float)res.y }; + + tech_opt_ordered.clear(); + tech_opt_ordered.emplace_back(); + tech_opt_ordered.emplace_back(); + tech_opt_ordered.emplace_back(); + tech_opt_ordered.emplace_back(); + + for (OptionTech opt : tech_options) { + tech_opt_ordered[opt.tech->level].emplace_back(opt); + } + int maxsize = 0; + for (auto v : tech_opt_ordered) { + maxsize = maxsize < v.size() ? v.size() : maxsize; + } + + float width = 150 * tech_opt_ordered.size(); + float height = maxsize * 10; + size = vec2 { width, height+20 }; + pos *= 0.5f; + pos -= size/2; +} + +int Menu_tech::mouse_option (vec2 mouse) { + float x = 0, y = 0; + for (auto v : tech_opt_ordered) { + for (auto opt : v) { + vec2 off { x*150, 10.0f + y*10 }; + vec2 sizeopt { 150, 10 }; + off += pos; + if (off.x < mouse.x && mouse.x < off.x+sizeopt.x + && off.y < mouse.y && mouse.y < off.y+sizeopt.y ) { + return opt.tech->id; + } + y++; + } + x++; y=0; + } + return -1; } \ No newline at end of file diff --git a/game/menu.h b/game/menu.h index bf181b5..462d893 100644 --- a/game/menu.h +++ b/game/menu.h @@ -5,6 +5,7 @@ #include #include "../umath/vec2.h" +#include "tech.h" class Option { public: @@ -22,10 +23,11 @@ class Menu { bool active { false }; std::vector