diff options
26 files changed, 267 insertions, 828 deletions
diff --git a/CMakeFiles/sdl_test.dir/CXX.includecache b/CMakeFiles/sdl_test.dir/CXX.includecache index c1a7a4e..35f1a7b 100644 --- a/CMakeFiles/sdl_test.dir/CXX.includecache +++ b/CMakeFiles/sdl_test.dir/CXX.includecache @@ -6,630 +6,6 @@ #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.h vector - @@ -644,6 +20,14 @@ C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.h entity.h C:/Users/jaksk/Desktop/dev/_cpp/age/game/entity.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.cpp +gst.h +C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h +map +- +iostream +- + C:/Users/jaksk/Desktop/dev/_cpp/age/game/gst.h iostream - @@ -655,6 +39,8 @@ vector - functional - +random +- ground.h C:/Users/jaksk/Desktop/dev/_cpp/age/game/ground.h entity.h @@ -666,38 +52,12 @@ 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.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/player.h vector - tech.h C:/Users/jaksk/Desktop/dev/_cpp/age/game/tech.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 - @@ -716,65 +76,5 @@ string ../umath/vec2.h C:/Users/jaksk/Desktop/dev/_cpp/age/umath/vec2.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.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/game/entity.cpp.obj b/CMakeFiles/sdl_test.dir/game/entity.cpp.obj Binary files differindex 270756b..9ffa947 100644 --- a/CMakeFiles/sdl_test.dir/game/entity.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/entity.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/game/ground.cpp.obj b/CMakeFiles/sdl_test.dir/game/ground.cpp.obj Binary files differindex e8fe88d..202faa3 100644 --- a/CMakeFiles/sdl_test.dir/game/ground.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/ground.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/game/gst.cpp.obj b/CMakeFiles/sdl_test.dir/game/gst.cpp.obj Binary files differindex 622f3c3..36785f4 100644 --- a/CMakeFiles/sdl_test.dir/game/gst.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/gst.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/game/load.cpp.obj b/CMakeFiles/sdl_test.dir/game/load.cpp.obj Binary files differindex b227260..d56f060 100644 --- a/CMakeFiles/sdl_test.dir/game/load.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/load.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj b/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj Binary files differindex c1c6716..052b295 100644 --- a/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/playercontrol.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/game/view.cpp.obj b/CMakeFiles/sdl_test.dir/game/view.cpp.obj Binary files differindex 1495405..16d37bd 100644 --- a/CMakeFiles/sdl_test.dir/game/view.cpp.obj +++ b/CMakeFiles/sdl_test.dir/game/view.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj b/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj Binary files differindex d3970de..897dbd3 100644 --- a/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj +++ b/CMakeFiles/sdl_test.dir/graphics/graphics.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/main.cpp.obj b/CMakeFiles/sdl_test.dir/main.cpp.obj Binary files differindex d873aa1..c12da38 100644 --- a/CMakeFiles/sdl_test.dir/main.cpp.obj +++ b/CMakeFiles/sdl_test.dir/main.cpp.obj diff --git a/CMakeFiles/sdl_test.dir/objects.a b/CMakeFiles/sdl_test.dir/objects.a Binary files differindex 35d3bbc..696878e 100644 --- a/CMakeFiles/sdl_test.dir/objects.a +++ b/CMakeFiles/sdl_test.dir/objects.a diff --git a/CMakeFiles/sdl_test.dir/sta06748 b/CMakeFiles/sdl_test.dir/sta06748 new file mode 100644 index 0000000..8b277f0 --- /dev/null +++ b/CMakeFiles/sdl_test.dir/sta06748 @@ -0,0 +1 @@ +!<arch> diff --git a/build/content/entities.json b/build/content/entities.json index db04571..99746a0 100644 --- a/build/content/entities.json +++ b/build/content/entities.json @@ -2,12 +2,13 @@ { "name": "Town Center", "id": 100, "unit": 0, "class": "bld", "level": 0, - "move" : 0, "attack": 0, "defence": 600, + "move" : 0, "attack": 0, "defence": 500, "range": 0, "sight": 10, "spritebounds": [ 528, 16 ], - "train": [ 0 ], + "train_id": [ 0 ], "prod": [ 30, 25 ], - "cost": [ 600, 400 ] + "cost": [ 600, 400 ], + "defence_bonus": 0.2 },{ "name": "Mill", "id": 101, "unit": 0, "class": "bld", "level": 0, @@ -15,7 +16,8 @@ "range": 0, "sight": 7, "spritebounds": [ 544, 16 ], "prod": [ 50, 0 ], - "cost": [ 120, 90 ] + "cost": [ 120, 90 ], + "defence_bonus": 0.2 },{ "name": "Mine", "id": 102, "unit": 0, "class": "bld", "level": 0, @@ -23,36 +25,40 @@ "range": 0, "sight": 7, "spritebounds": [ 560, 16 ], "prod": [ 0, 150 ], - "cost": [ 360, 240 ] + "cost": [ 360, 240 ], + "defence_bonus": 0.2 },{ "name": "Farm", "id": 103, "unit": 0, "class": "bld", "level": 0, - "move" : 0, "attack": 0, "defence": 150, + "move" : 0, "attack": 0, "defence": 100, "range": 0, "sight": 7, "spritebounds": [ 576, 16 ], "prod": [ 50, 0 ], "cost": [ 90, 60 ], - "adjacent": [ 101 ] + "adjacent": [ 101 ], + "defence_bonus": 0.1 },{ "name": "Barracks", "id": 104, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 592, 16 ], - "train": [ 1 ], + "train_class": [ "inf" ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Archery Range", "id": 105, "unit": 0, "class": "bld", "level": 1, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 608, 32 ], - "train": [ 5 ], + "train_class": [ "ran" ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Blacksmith", "id": 106, "unit": 0, "class": "bld", "level": 1, @@ -61,43 +67,52 @@ "spritebounds": [ 624, 32 ], "prod": [ 0, 0 ], "cost": [ 285, 165 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Market", "id": 107, "unit": 0, "class": "bld", "level": 1, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 640, 32 ], + "train_class": [ "inf", "cav", "ran", "sie" ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Stable", "id": 108, "unit": 0, "class": "bld", "level": 0, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 656, 16 ], + "train_class": [ "cav" ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Siege Workshop", "id": 109, "unit": 0, "class": "bld", "level": 2, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 672, 48 ], + "train_class": [ "sie" ], "prod": [ 0, 0 ], - "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "cost": [ 450, 300 ], + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Church", "id": 110, "unit": 0, "class": "bld", "level": 2, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 688, 48 ], + "train_id": [ 23 ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "University", "id": 111, "unit": 0, "class": "bld", "level": 2, @@ -105,8 +120,9 @@ "range": 0, "sight": 7, "spritebounds": [ 704, 48 ], "prod": [ 0, 0 ], - "cost": [ 360, 240 ], - "adjacent": [ 100 ] + "cost": [ 450, 300 ], + "adjacent": [ 100 ], + "defence_bonus": 0.2 },{ "name": "Tower", "id": 112, "unit": 0, "class": "bld", "level": 1, @@ -115,16 +131,19 @@ "spritebounds": [ 720, 48 ], "prod": [ 0, 0 ], "cost": [ 360, 240 ], - "diagonal": [ 100 ] + "diagonal": [ 100 ], + "defence_bonus": 0.4 },{ "name": "Castle", "id": 113, "unit": 0, "class": "bld", "level": 2, "move" : 0, "attack": 0, "defence": 300, "range": 0, "sight": 7, "spritebounds": [ 720, 48 ], + "train_class": [ "inf" ], "prod": [ 0, 0 ], - "cost": [ 360, 240 ], - "diagonal": [ 100 ] + "cost": [ 900, 600 ], + "diagonal": [ 100 ], + "defence_bonus": 0.4 },{ "name": "Villager", "id": 0, "unit": 1, "class": "inf", "level": -1, @@ -150,16 +169,15 @@ "move" : 12, "attack": 100, "defence": 100, "range": 1, "sight": 7, "spritebounds": [ 128, 16 ], - "cost": [ 100, 50 ], - "abilities": [ "Scout" ], - "upgrade": 5 + "cost": [ 120, 30 ], + "abilities": [ "Scout" ] },{ "name": "Archers", "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": [ 105, 45 ], "upgrade": 24 },{ "name": "Skirmishers", @@ -167,7 +185,7 @@ "move" : 7, "attack": 110, "defence": 110, "range": 2, "sight": 7, "spritebounds": [ 176, 32 ], - "cost": [ 125, 50 ], + "cost": [ 95, 40 ], "abilities": [ "Skirmish" ], "upgrade": 14 },{ @@ -176,7 +194,7 @@ "move" : 10, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 128, 32 ], - "cost": [ 125, 50 ], + "cost": [ 140, 35 ], "abilities": [ "Plains Charge" ], "upgrade": 8 },{ @@ -185,7 +203,7 @@ "move" : 7, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 112, 32 ], - "cost": [ 125, 50 ], + "cost": [ 95, 30 ], "upgrade": 10 },{ "name": "Spearmen", @@ -193,7 +211,7 @@ "move" : 7, "attack": 150, "defence": 150, "range": 1, "sight": 7, "spritebounds": [ 144, 32 ], - "cost": [ 125, 50 ], + "cost": [ 115, 40 ], "abilities": [ "Anti-Cavalry" ], "upgrade": 11 },{ @@ -202,7 +220,7 @@ "move" : 10, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 128, 48 ], - "cost": [ 125, 50 ], + "cost": [ 190, 45 ], "abilities": [ "Plains Charge" ] },{ "name": "Camels", @@ -210,7 +228,7 @@ "move" : 10, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 192, 48 ], - "cost": [ 125, 50 ], + "cost": [ 200, 50 ], "abilities": [ "Desert Charge", "Scares Horses" ] },{ "name": "Longswordmen", @@ -218,14 +236,14 @@ "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 112, 48 ], - "cost": [ 125, 50 ] + "cost": [ 130, 45 ] },{ "name": "Pikemen", "id": 11, "unit": 1, "class": "inf", "level": 2, "move" : 7, "attack": 150, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 144, 48 ], - "cost": [ 125, 50 ], + "cost": [ 160, 55 ], "abilities": [ "Anti-Cavalry" ] },{ "name": "Viking Berserkers", @@ -233,7 +251,7 @@ "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 208, 48 ], - "cost": [ 125, 50 ], + "cost": [ 170, 55 ], "abilities": [ "Frenzy" ] },{ "name": "Crossbowmen", @@ -272,7 +290,7 @@ "move" : 7, "attack": 200, "defence": 250, "range": 1, "sight": 7, "spritebounds": [ 272, 48 ], - "cost": [ 125, 50 ], + "cost": [ 210, 55 ], "abilities": [ "Causes Fear" ] },{ "name": "Celtic Woad Raiders", @@ -280,7 +298,7 @@ "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 288, 48 ], - "cost": [ 125, 50 ], + "cost": [ 200, 65 ], "abilities": [ "Causes Fear" ] },{ "name": "Knights Templar", @@ -288,7 +306,7 @@ "move" : 7, "attack": 200, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 304, 48 ], - "cost": [ 125, 50 ], + "cost": [ 215, 55 ], "abilities": [ "Plains Charge", "Zeal" ] },{ "name": "Scorpions", @@ -296,7 +314,7 @@ "move" : 7, "attack": 350, "defence": 250, "range": 3, "sight": 7, "spritebounds": [ 320, 48 ], - "cost": [ 125, 50 ], + "cost": [ 65, 190 ], "abilities": [ "Units Only", "No Counter", "No Move & Attack" ] },{ "name": "Battering Rams", @@ -304,7 +322,7 @@ "move" : 7, "attack": 400, "defence": 325, "range": 1, "sight": 7, "spritebounds": [ 336, 48 ], - "cost": [ 125, 50 ], + "cost": [ 50, 155 ], "abilities": [ "Buildings Only", "No Counter" ] },{ "name": "Onagers", @@ -312,7 +330,7 @@ "move" : 7, "attack": 275, "defence": 275, "range": 1, "sight": 7, "spritebounds": [ 352, 48 ], - "cost": [ 125, 50 ], + "cost": [ 60, 180 ], "abilities": [ "No Move & Attack", "No Counter" ] },{ "name": "Monks", @@ -320,7 +338,7 @@ "move" : 7, "attack": 50, "defence": 200, "range": 1, "sight": 7, "spritebounds": [ 368, 48 ], - "cost": [ 125, 50 ], + "cost": [ 50, 155 ], "abilities": [ "Heal", "Convert" ] },{ "name": "Archers", diff --git a/build/content/raw_ents name.json b/build/content/raw_ents name.json index 62f2a05..e80a1c3 100644 --- a/build/content/raw_ents name.json +++ b/build/content/raw_ents name.json @@ -52,7 +52,7 @@ Age 4: Unit name: Two Handed Swordsmen Unit name: Elite Pikemen -Unit name: Expert Archers +Unit name: Elite Archers Unit name: Arbalests Unit name: Expert Skirmishers Unit name: Hvy Horse Archers diff --git a/build/content/sprites.bmp b/build/content/sprites.bmp Binary files differindex 4a70921..ec68561 100644 --- a/build/content/sprites.bmp +++ b/build/content/sprites.bmp diff --git a/build/content/techs.json b/build/content/techs.json index 3476177..37e066b 100644 --- a/build/content/techs.json +++ b/build/content/techs.json @@ -229,11 +229,7 @@ } },{ "name": "Merchant Network", "id": 31, "level": 2, - "cost": [ 150, 450 ], "req_id": 107, - "bonus": { - "aff_mercs": 1, - "cost_abs": [ 0, -25 ] - } + "cost": [ 150, 450 ], "req_id": 107 },{ "name": "Redemption", "id": 32, "level": 2, "cost": [ 150, 450 ], "req_id": 110, diff --git a/build/sdl_test.exe b/build/sdl_test.exe Binary files differindex 752ac84..efe1996 100644 --- a/build/sdl_test.exe +++ b/build/sdl_test.exe diff --git a/game/constants.h b/game/constants.h index 7ea34e0..2ba343a 100644 --- a/game/constants.h +++ b/game/constants.h @@ -8,6 +8,10 @@ namespace constants { const int col_bad_r = 255; const int col_bad_g = 120; const int col_bad_b = 0; + + const float menu_attack_margin_amt = 60; + const float menu_attack_margin_arrow = 80; + const float menu_attack_margin_mod = 93; } #endif
\ No newline at end of file diff --git a/game/entity.cpp b/game/entity.cpp index 8362c40..f127150 100644 --- a/game/entity.cpp +++ b/game/entity.cpp @@ -1,3 +1,11 @@ #include "entity.h" #include <iostream> -;
\ No newline at end of file + + +int EntityClass::from_string (std::string str) { + if (str == "inf") return EntityInfo::Class::inf; + if (str == "cav") return EntityInfo::Class::cav; + if (str == "ran") return EntityInfo::Class::ran; + if (str == "sie") return EntityInfo::Class::sie; + if (str == "bld") return EntityInfo::Class::bld; +}
\ No newline at end of file diff --git a/game/entity.h b/game/entity.h index 50c7acc..8f61cee 100644 --- a/game/entity.h +++ b/game/entity.h @@ -13,6 +13,9 @@ class EntityInfo { public: EntityInfo() { spritebounds = vec2 { 16*6, 16 }; } + enum Class { inf, cav, ran, sie, bld }; + Class ent_class; + std::string name; int id; @@ -27,21 +30,23 @@ class EntityInfo { int unit; std::vector<int> abilities; std::vector<int> build; - std::vector<int> train; + std::vector<int> train_id; + std::vector<Class> train_class; std::vector<float> prod { 0, 0 }; std::vector<float> cost { 0, 0 }; std::vector<int> adjacent; - + float defence_bonus { 0 }; int upgrade { -1 }; - enum Class { inf, cav, ran, sie, bld }; - Class ent_class; - vec2 spritebounds; }; +namespace EntityClass { + int from_string(std::string str); +} + class Entity { public: Entity(int x, int y, EntityInfo *info, int owner) @@ -58,6 +63,7 @@ class Entity { bool done = false; int moved; EntityInfo *info; + int fights { 0 }; int owner; }; diff --git a/game/gst.cpp b/game/gst.cpp index 5c7485b..3c0c1de 100644 --- a/game/gst.cpp +++ b/game/gst.cpp @@ -3,6 +3,7 @@ #include <map> #include <iostream> + Player& Gst::get_player (int id) { for (auto &player : players) { if (id == player.id) return player; @@ -80,6 +81,8 @@ float Gst::get_type_bonus (Entity &atk, Entity &def) { return b; } +int Gst::get_vet_level (Entity &ent) { return std::min(3, ent.fights/3); } + std::vector<Bonus> Gst::get_bonuses (Entity &atk, Entity &def) { std::vector<Bonus> bs; if (tiles[ground.tiles[ground.at(atk.x, atk.y)]].attack_bonus != 0) { @@ -93,13 +96,23 @@ std::vector<Bonus> Gst::get_bonuses (Entity &atk, Entity &def) { tiles[ground.tiles[ground.at(def.x, def.y)]].defence_bonus, Bonus::Id::ground, false); } + + if (check_obstructed(def)) { + for (Entity &e : entities) { + if (&def != &e && e.x == def.x && def.y == e.y) { + bs.emplace_back(e.info->defence_bonus, + Bonus::Id::on_bld, false); + } + } + } if (get_type_bonus(atk, def) != 0) { bs.emplace_back(get_type_bonus(atk, def), Bonus::Id::type, true); } + /* only attack bonuses 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); @@ -132,7 +145,6 @@ std::vector<Bonus> Gst::get_bonuses (Entity &atk, Entity &def) { if (info_has_ability(atk.info, "Frenzy")) bs.emplace_back(1/atk.hp, Bonus::Id::ability, true); - Player &player_atk = players[atk.owner]; Player &player_def = players[def.owner]; float tech_attack = player_atk.tech_lookup.id(atk.info->id).attack; @@ -142,6 +154,13 @@ std::vector<Bonus> Gst::get_bonuses (Entity &atk, Entity &def) { if (tech_defence != 0) bs.emplace_back(tech_defence, Bonus::Id::tech, false); + float atk_vet = get_vet_level(atk) * 0.15f; + if (atk_vet > 0) + bs.emplace_back(atk_vet, Bonus::Id::veteran, true); + float def_vet = get_vet_level(def) * 0.15f; + if (def_vet > 0) + bs.emplace_back(def_vet, Bonus::Id::veteran, false); + return bs; } @@ -243,6 +262,9 @@ void Gst::battle (Entity &atk, Entity &def) { atk.hp = result.atk_hp; def.hp = result.def_hp; + if (atk.info->unit == 1) atk.fights += 1; + if (def.info->unit == 1) def.fights += 1; + std::cout << "! result " << atk.info->name << "(hp:" << atk.hp << "), " << def.info->name << "(hp:" << def.hp << ") \n"; clear_dead(); @@ -267,6 +289,49 @@ int Gst::get_range (Entity &ent) { return range; } +std::vector<int> Gst::get_possible_trains (Entity &ent) { + Player &player = get_player(ent.owner); + auto &cls = ent.info->train_class; + std::vector<int> trains; + if (ent.info->id == 107) { // market special case + std::vector<int> candidates; + for (EntityInfo &info : infos) { + if (info.id == 0) continue; // villager only in train_id + if (info.level > player.level) continue; + if (info.level < player.level && info.upgrade != -1) continue; + if (std::find(cls.begin(), cls.end(), info.ent_class) != cls.end()) + { + candidates.push_back(info.id); + } + } + std::shuffle(candidates.begin(), candidates.end(), engine); + // pick 3 cands at random + for (int i=0; i<3; i++) trains.push_back(candidates[i]); + return trains; + } + + for (int id : ent.info->train_id) { + if (get_info(id)->level > player.level) { + trains.push_back(id); + } + } + + // get all train class ids, highest upgrade level + for (EntityInfo &info : infos) { + if (info.id == 0) continue; // villager only in train_id + if (info.level > player.level) continue; + if (info.level < player.level && info.upgrade != -1) continue; + if (std::find(cls.begin(), cls.end(), info.ent_class) != cls.end()) { + if (std::find(trains.begin(), trains.end(), info.id) + == trains.end()) + { + trains.push_back(info.id); + } + } + } + return trains; +} + std::vector<int> Gst::get_possible_builds (Entity &ent) { std::vector<int> builds; for (int id : ent.info->build) { @@ -308,7 +373,6 @@ bool Gst::check_req_build(Entity &ent, EntityInfo *info) { } } } - std::cout << " " << mindist; if (mindist < 5) { return false; } @@ -335,12 +399,6 @@ bool Gst::check_req_build(Entity &ent, EntityInfo *info) { return true; } -bool Gst::check_req_train (Entity &ent, EntityInfo *info) { - Player &player = players[ent.owner]; - if (player.level < info->level) return false; - return true; -} - bool Gst::check_req_tech (Tech *tech, Player &player) { if (player.leveling_up == 1) return false; @@ -7,6 +7,8 @@ #include <vector> #include <functional> +#include <random> // just for picking market trains + #include "ground.h" #include "entity.h" #include "tile.h" @@ -23,13 +25,16 @@ class Bonus { public: 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 }; + enum Id { ground, type, ability, tech, veteran, on_bld, adjacency }; std::string id_string () { switch (id) { case ground: return "Ground"; case type: return "Class"; case ability: return "Ability"; case tech: return "Tech"; + case veteran: return "Veteran"; + case on_bld: return "On Building"; + case adjacency: return "Adjacency"; } } }; @@ -42,8 +47,9 @@ class BattleResult { }; class Gst { + private: std::default_random_engine engine = std::default_random_engine{}; public: - Gst(int sx, int sy) : ground(sx, sy) {} + Gst(int sx, int sy) : ground(sx, sy) { } std::vector<Tech> techs; std::vector<Ability> abilities; @@ -63,6 +69,7 @@ class Gst { std::vector<float> get_cost (EntityInfo *info, Player &player); float get_trade_rate (Player &player); + int get_vet_level (Entity &ent); float get_type_bonus (Entity &atk, Entity &def); std::vector<Bonus> get_bonuses (Entity &atk, Entity &def); float get_damage (Entity &atk, Entity &def); @@ -73,10 +80,10 @@ class Gst { void clear_dead(); int get_range(Entity &ent); + std::vector<int> get_possible_trains (Entity &ent); std::vector<int> get_possible_builds (Entity &ent); bool check_req_build (Entity &ent, EntityInfo *info); - bool check_req_train (Entity &ent, EntityInfo *info); bool check_req_tech (Tech *tech, Player &player); bool check_req_level (Player &player); bool check_obstructed (Entity &ent); diff --git a/game/load.cpp b/game/load.cpp index c9c9132..16f0911 100644 --- a/game/load.cpp +++ b/game/load.cpp @@ -69,18 +69,18 @@ void load_json (Gst &gst) { for (auto blds : it["build"]) { ent.build.push_back(blds); } - for (auto train : it["train"]) { - ent.train.push_back(train); + for (auto train : it["train_id"]) { + ent.train_id.push_back(train); + } + for (auto train : it["train_class"]) { + ent.train_class.push_back((EntityInfo::Class) + EntityClass::from_string(train.get<std::string>())); } for (auto ad : it["adjacent"]) { ent.adjacent.push_back(ad); } - std::string cl = it["class"]; - if (cl == "inf") ent.ent_class = EntityInfo::Class::inf; - if (cl == "cav") ent.ent_class = EntityInfo::Class::cav; - if (cl == "ran") ent.ent_class = EntityInfo::Class::ran; - if (cl == "sie") ent.ent_class = EntityInfo::Class::sie; - if (cl == "bld") ent.ent_class = EntityInfo::Class::bld; + ent.ent_class = (EntityInfo::Class) EntityClass::from_string( + it["class"].get<std::string>()); for (auto ab : it["abilities"]) { int index = 0; for (int i=0; i<gst.abilities.size(); i++) { @@ -90,6 +90,9 @@ void load_json (Gst &gst) { } ent.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; if (it.contains("upgrade")) { ent.upgrade = it["upgrade"]; } + if (it.contains("defence_bonus")) { + ent.defence_bonus = it["defence_bonus"]; + } gst.infos.push_back(ent); } @@ -126,13 +129,8 @@ void load_json (Gst &gst) { for (auto v : b["aff_id"]) { tech.bonus.aff_id.push_back(v); } for (auto v : b["aff_class"]) { - int w = -1; - if (v == "inf") w = EntityInfo::Class::inf; - if (v == "cav") w = EntityInfo::Class::cav; - if (v == "ran") w = EntityInfo::Class::ran; - if (v == "sie") w = EntityInfo::Class::sie; - if (v == "bld") w = EntityInfo::Class::bld; - tech.bonus.aff_class.push_back(w); + tech.bonus.aff_class.push_back(EntityClass::from_string( + v.get<std::string>())); } if (b.contains("aff_level")) { tech.bonus.aff_level = b["aff_level"]; diff --git a/game/playercontrol.cpp b/game/playercontrol.cpp index 284c6ff..23c9f3e 100644 --- a/game/playercontrol.cpp +++ b/game/playercontrol.cpp @@ -31,7 +31,7 @@ void open_unit_menu (Gst &gst, View &view, Fsm &fsm, int p) { view.menu_unit.options.emplace_back("Done", Menu_unit::Opts::done); } else { - if (ent.info->train.size() + if (gst.get_possible_trains(ent).size() && !gst.check_obstructed(ent)) { view.menu_unit.options.emplace_back("Train", @@ -157,14 +157,17 @@ Player_control::Player_control () { Entity &ent = gst.entities[view.selected_entity]; Player &player = gst.players[ent.owner]; view.menu_train.options.clear(); - for (int id : ent.info->train) { + auto trains = gst.get_possible_trains(ent); + for (int id : trains) { EntityInfo *info = gst.get_info(id); - if (gst.check_req_train(ent, info)) { - std::cout << id << " " << gst.get_info(id)->name << "\n"; - Option opt { info->name, id }; - opt.cost = gst.get_cost(info, player); - view.menu_train.options.push_back(opt); + std::cout << id << " " << gst.get_info(id)->name << "\n"; + Option opt { info->name, id }; + opt.cost = gst.get_cost(info, player); + if (ent.info->id == 107) { // market + // tech.id = 31 -> merc network + opt.cost[1] += 50 - (int)player.has_tech(31)*25; } + view.menu_train.options.push_back(opt); } view.menu_train.open(view.res); return menu_train; @@ -173,6 +176,10 @@ Player_control::Player_control () { fsm.arcs.emplace_back( menu_train, opt, -1, [](Gst &gst, View &view, Fsm &fsm, int p) { + std::vector<float> cost { -1, -1 }; + for (auto o : view.menu_train.options) { + if (o.id == p) {cost = o.cost; break; } + } view.menu_train.close(); Entity &ent = gst.entities[view.selected_entity]; ent.done = true; @@ -182,7 +189,7 @@ Player_control::Player_control () { entb.hp = 50; gst.entities.push_back(entb); Player &player = gst.players[gst.turn]; - player.pay(gst.get_cost(entb.info, player)); + player.pay(cost); view.selected_entity = -1; return select; } diff --git a/graphics/graphics.cpp b/graphics/graphics.cpp index 71ff3b8..e485fb4 100644 --- a/graphics/graphics.cpp +++ b/graphics/graphics.cpp @@ -20,17 +20,19 @@ void render_ent (Graphics *graphics, Gst &gst, Entity &ent, vec2 pos, int dflag) { Player &player = gst.players[ent.owner]; + float bound_y = ent.info->spritebounds.y; + if (ent.info->unit == 0) { bound_y = player.level*16+16; } int done = 0; if (dflag == 1) done = 512; graphics->backend.render_sprite( (int)ent.info->spritebounds.x, - (int)ent.info->spritebounds.y+done, 16, 16, + (int)bound_y+done, 16, 16, (int)pos.x, (int)pos.y, 32, 32 ); if (dflag == 0) { graphics->backend.render_sprite( (int)ent.info->spritebounds.x, - (int)ent.info->spritebounds.y+768, 16, 16, + (int)bound_y+768, 16, 16, (int)pos.x, (int)pos.y, 32, 32, player.r, player.g, player.b ); @@ -243,6 +245,10 @@ void render_tile_info (Graphics *graphics, Gst &gst, vec2 pos, int i) { int render_attack_info_bonus (Graphics *graphics, Gst &gst, vec2 pos, Entity &atk, Entity &def, bool attack, int rtl) { + float margin_amt = constants::menu_attack_margin_amt; + float margin_arrow = constants::menu_attack_margin_arrow; + float margin_mod = constants::menu_attack_margin_mod; + std::vector<Bonus> bonuses; if (attack) { bonuses = gst.get_bonuses(atk, def); } else { bonuses = gst.get_bonuses(def, atk); } @@ -258,7 +264,7 @@ int render_attack_info_bonus (Graphics *graphics, Gst &gst, vec2 pos, std::string nlabel = std::to_string((int)roundf(value)); float labw = graphics->backend.txt.get_width(nlabel); graphics->backend.txt.render_text(nlabel, - pos + vec2 { 50*(1-rtl*2)-labw*rtl, 0 }); + pos + vec2 { margin_amt*(1-rtl*2)-labw*rtl, 0 }); } int bonusnum = 0; float atk_mod = 1; @@ -273,7 +279,9 @@ int render_attack_info_bonus (Graphics *graphics, Gst &gst, vec2 pos, amt += std::to_string((int)roundf(b.amt*100)) + "%"; float labw = graphics->backend.txt.get_width(amt); graphics->backend.txt.render_text( - amt, pos + vec2 { 50*(1-rtl*2)-labw*rtl, 10.0f+bonusnum*10 }); + amt, pos + vec2 { + margin_amt*(1-rtl*2)-labw*rtl, + 10.0f+bonusnum*10 }); atk_mod += b.amt; bonusnum ++; } @@ -281,16 +289,16 @@ int render_attack_info_bonus (Graphics *graphics, Gst &gst, vec2 pos, if (bonusnum > 0) { { - std::string label = attack ? "->" : "<-"; + std::string label = rtl ? "<-" : "->"; float labw = graphics->backend.txt.get_width(label); graphics->backend.txt.render_text(label, - pos + vec2 { 70*(1-rtl*2)-labw*rtl, 0 }); + pos + vec2 { margin_arrow*(1-rtl*2)-labw*rtl, 0 }); } { std::string label = std::to_string((int)roundf(value * atk_mod)); float labw = graphics->backend.txt.get_width(label); graphics->backend.txt.render_text(label, - pos + vec2 { 83*(1-rtl*2)-labw*rtl, 0 }); + pos + vec2 { margin_mod*(1-rtl*2)-labw*rtl, 0 }); } } @@ -299,6 +307,10 @@ int render_attack_info_bonus (Graphics *graphics, Gst &gst, vec2 pos, void render_attack_info (Graphics *graphics, Gst &gst, vec2 pos, int i, int j) { + float margin_amt = constants::menu_attack_margin_amt; + float margin_arrow = constants::menu_attack_margin_arrow; + float margin_mod = constants::menu_attack_margin_mod; + Entity &atk = gst.entities[i]; Entity &def = gst.entities[j]; int w = 300, h = 250; @@ -374,11 +386,16 @@ void render_attack_info (Graphics *graphics, Gst &gst, vec2 pos, int i, int j) { graphics->backend.txt.render_text("Health", pos + vec2 { 10, 80 }); graphics->backend.txt.render_text( - std::to_string((int)roundf(atk.hp)), pos + vec2 { 60, 80 }); - graphics->backend.txt.render_text("->", pos + vec2 { 80, 80 }); + std::to_string((int)roundf(atk.hp)), + pos + vec2 { 10+margin_amt, 80 }); + graphics->backend.txt.render_text("->", + pos + vec2 { 10+margin_arrow, 80 }); graphics->backend.txt.render_text( - std::to_string((int)roundf(result.atk_hp)), pos + vec2 { 93, 80 }); - graphics->backend.txt.render_text(sres[atk_res], pos + vec2 { 115, 80 }); + std::to_string((int)roundf(result.atk_hp)), + pos + vec2 { 10+margin_mod, 80 }); + graphics->backend.txt.render_text( + sres[atk_res], + pos + vec2 { 10+margin_mod+20, 80 }); { int txtwidth = graphics->backend.txt.get_width("Health"); graphics->backend.txt.render_text("Health", @@ -386,20 +403,20 @@ void render_attack_info (Graphics *graphics, Gst &gst, vec2 pos, int i, int j) { std::string label = std::to_string((int)roundf(def.hp)); int txtwidthlabel = graphics->backend.txt.get_width(label); graphics->backend.txt.render_text(label, - pos + vec2 { w-60.0f-txtwidthlabel, 80 }); + pos + vec2 { w-10.0f-margin_amt-txtwidthlabel, 80 }); } { int txtwidth = graphics->backend.txt.get_width("<-"); graphics->backend.txt.render_text("<-", - pos + vec2 { w-80.0f-txtwidth, 80 }); + pos + vec2 { w-10.0f-margin_arrow-txtwidth, 80 }); } { std::string label = std::to_string((int)roundf(result.def_hp)); int txtwidth = graphics->backend.txt.get_width(label); graphics->backend.txt.render_text(label, - pos + vec2 { w-93.0f-txtwidth, 80 }); + pos + vec2 { w-10.0f-margin_mod-txtwidth, 80 }); } { int txtwidth = graphics->backend.txt.get_width(sres[def_res]); graphics->backend.txt.render_text(sres[def_res], - pos + vec2 { w-115.0f-txtwidth, 80 }); + pos + vec2 { w-10.0f-margin_mod-20-txtwidth, 80 }); } { @@ -458,10 +475,14 @@ void Graphics::render (Gst &gst, View &view) if (view.selected_entity != -1) { int i = view.selected_entity; - vec2 pos { (float)entities[i].x*32, (float)entities[i].y*32 }; + Entity &ent = entities[i]; + Player &player = gst.get_player(ent.owner); + float bound_y = ent.info->spritebounds.y; + if (ent.info->unit == 0) { bound_y = player.level*16+16; } + vec2 pos { (float)ent.x*32, (float)ent.y*32 }; backend.render_sprite ( - (int)entities[i].info->spritebounds.x, - (int)entities[i].info->spritebounds.y+256, 16, 16, + (int)ent.info->spritebounds.x, + (int)bound_y+256, 16, 16, (int)cam.pos.x + (int)pos.x, (int)cam.pos.y + (int)pos.y, 32, 32 ); @@ -481,18 +502,19 @@ void Graphics::render (Gst &gst, View &view) } for (int i=0; i<entities.size(); i++) { - if (entities[i].info->unit == 1) { + Entity &ent = entities[i]; + if (ent.info->unit == 1) { backend.render_rect( 0, 0, 0, 255, - (int)cam.pos.x + (int)entities[i].x*32+2, - (int)cam.pos.y + (int)entities[i].y*32+30, 28, 2 + (int)cam.pos.x + (int)ent.x*32+2, + (int)cam.pos.y + (int)ent.y*32+30, 28, 2 ); int amt = 28 * (entities[i].hp / 100); - Player &player = gst.players[entities[i].owner]; + Player &player = gst.get_player(ent.owner); backend.render_rect( player.r, player.g, player.b, 255, - (int)cam.pos.x + (int)entities[i].x*32+2, - (int)cam.pos.y + (int)entities[i].y*32+30, amt, 2 + (int)cam.pos.x + (int)ent.x*32+2, + (int)cam.pos.y + (int)ent.y*32+30, amt, 2 ); } } @@ -62,6 +62,7 @@ int main () { gst.players[0].res = std::vector<float> { 1500, 1500 }; gst.players.emplace_back(0, 0, 255, 1); gst.players[1].res = std::vector<float> { 1500, 1500 }; + gst.players[0].level = 2; gst.ground.tiles[1] = 1; gst.ground.tiles[8] = 1; @@ -83,8 +84,10 @@ int main () { gst.entities.emplace_back(5, 1, gst.get_info("Town Center"), 0); gst.entities.emplace_back(6, 1, gst.get_info("Barracks"), 0); gst.entities.emplace_back(5, 0, gst.get_info("Stable"), 0); + gst.entities.emplace_back(4, 1, gst.get_info("Market"), 0); gst.entities.emplace_back(1, 1, gst.get_info("Villager"), 0); gst.entities.emplace_back(2, 1, gst.get_info("Light Cavalry"), 0); + gst.entities.emplace_back(4, 2, gst.get_info("Light Cavalry"), 1); gst.entities.emplace_back(10, 10, gst.get_info("Villager"), 1); gst.entities.emplace_back(1, 5, gst.get_info("Villager"), 1); gst.entities.emplace_back(2, 5, gst.get_info("Militia"), 1); @@ -1,3 +1,4 @@ +DEV [x] level restrict train and build [x] current tech gui [x] tech bonus addition @@ -6,25 +7,35 @@ [x] age up menu [x] end day upgrade on age up [x] end day heal when on bld -[ ] bld ages upgrades -[ ] train problem +[x] bld ages upgrades (just graphical) +[x] train problem +[x] market (+50g mercs) +[x] tech effects +[x] veterancy ranks [ ] heal [ ] convert [ ] relics [ ] tower diagonal constraint [ ] tower defence effect -> new bonus type [ ] castle -[ ] veterancy ranks [ ] frenzy special case [ ] gui production [ ] gui train build -[ ] tech effects [ ] unit tech requirement (paladin, champion, imp siege) [ ] fsm back [ ] undo +[x] bld defence bonus +[ ] demolish +[ ] imp entities +[ ] use maps to speed up lookups (even in ground.pos -> ent) + +ART [ ] imp unit sprites [x] sprites stable, castle, uni, market, church, tower and bld upgrade +BUGS [ ] wheelbarrow doesn't work -[ ] search player by id, not by index
\ No newline at end of file +[ ] search player by id, not by index + +[x] trained man at arms, bad alloc
\ No newline at end of file |