lugaru-0~20110520.1+hge4354.orig/0000755000000000000000000000000011571222446014402 5ustar rootrootlugaru-0~20110520.1+hge4354.orig/cmake/0000755000000000000000000000000011571222446015462 5ustar rootrootlugaru-0~20110520.1+hge4354.orig/cmake/Modules/0000755000000000000000000000000011571222446017072 5ustar rootrootlugaru-0~20110520.1+hge4354.orig/cmake/Modules/FindOggVorbis.cmake0000644000000000000000000000703311571222446022601 0ustar rootroot# - Try to find the OggVorbis libraries # Once done this will define # # OGGVORBIS_FOUND - system has OggVorbis # OGGVORBIS_VERSION - set either to 1 or 2 # OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory # OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis # OGG_LIBRARY - The Ogg library # VORBIS_LIBRARY - The Vorbis library # VORBISFILE_LIBRARY - The VorbisFile library # VORBISENC_LIBRARY - The VorbisEnc library # Copyright (c) 2006, Richard Laerkaeng, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. include (CheckLibraryExists) find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) find_path(OGG_INCLUDE_DIR ogg/ogg.h) find_library(OGG_LIBRARY NAMES ogg) find_library(VORBIS_LIBRARY NAMES vorbis) find_library(VORBISFILE_LIBRARY NAMES vorbisfile) find_library(VORBISENC_LIBRARY NAMES vorbisenc) mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY) if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) set(OGGVORBIS_FOUND TRUE) set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY}) set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES}) check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP}) if (HAVE_LIBVORBISENC2) set (OGGVORBIS_VERSION 2) else (HAVE_LIBVORBISENC2) set (OGGVORBIS_VERSION 1) endif (HAVE_LIBVORBISENC2) else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) set (OGGVORBIS_VERSION) set(OGGVORBIS_FOUND FALSE) endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) if (OGGVORBIS_FOUND) if (NOT OggVorbis_FIND_QUIETLY) message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}") endif (NOT OggVorbis_FIND_QUIETLY) else (OGGVORBIS_FOUND) if (OggVorbis_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find OggVorbis libraries") endif (OggVorbis_FIND_REQUIRED) if (NOT OggVorbis_FIND_QUITELY) message(STATUS "Could NOT find OggVorbis libraries") endif (NOT OggVorbis_FIND_QUITELY) endif (OGGVORBIS_FOUND) #check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H) #check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG) #check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS) #check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE) #check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC) #check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) #if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) # message(STATUS "Ogg/Vorbis found") # set (VORBIS_LIBS "-lvorbis") # set (OGG_LIBS "-logg") # set (VORBISFILE_LIBS "-lvorbisfile") # set (VORBISENC_LIBS "-lvorbisenc") # set (OGGVORBIS_FOUND TRUE) # if (HAVE_LIBVORBISENC2) # set (HAVE_VORBIS 2) # else (HAVE_LIBVORBISENC2) # set (HAVE_VORBIS 1) # endif (HAVE_LIBVORBISENC2) #else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) # message(STATUS "Ogg/Vorbis not found") #endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) lugaru-0~20110520.1+hge4354.orig/CMakeLists.txt0000644000000000000000000004142711571222445017151 0ustar rootrootproject(lugaru) cmake_minimum_required(VERSION 2.6) set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source") set(DEPDIR "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" FORCE) endif(NOT CMAKE_BUILD_TYPE) if(NOT LUGARU_INSTALL_PREFIX) if(WIN32) set(LUGARU_INSTALL_PREFIX "C:/Lugaru" CACHE PATH "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories." FORCE) else(WIN32) set(LUGARU_INSTALL_PREFIX "/usr/local/lugaru" CACHE PATH "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories." FORCE) endif(WIN32) endif(NOT LUGARU_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE) if(MINGW) set(OPENGL_gl_LIBRARY "-lopengl32" CACHE STRING "OpenGL library for Win32" FORCE) set(OPENGL_glu_LIBRARY "-lglu32" CACHE STRING "GLU library for Win32" FORCE) endif(MINGW) if(APPLE) set(CMAKE_OSX_ARCHITECTURES "i386;x86_64;ppc" CACHE STRING "Build architectures for OSX") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value") set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE PATH "The product will be built against the headers and libraries located inside the indicated SDK.") endif(APPLE) if(APPLE) # Save our sanity; Set all available libraries to internal by default set(LUGARU_FORCE_INTERNAL_SDL True) set(LUGARU_FORCE_INTERNAL_GLU True) set(LUGARU_FORCE_INTERNAL_JPEG True) set(LUGARU_FORCE_INTERNAL_PNG True) set(LUGARU_FORCE_INTERNAL_VORBIS True) set(LUGARU_FORCE_INTERNAL_ZLIB True) endif(APPLE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(LUGARU_SRCS ${SRCDIR}/Frustum.cpp ${SRCDIR}/Account.cpp ${SRCDIR}/Game.cpp ${SRCDIR}/GameDraw.cpp ${SRCDIR}/GameInitDispose.cpp ${SRCDIR}/GameTick.cpp ${SRCDIR}/Globals.cpp ${SRCDIR}/Lights.cpp ${SRCDIR}/Models.cpp ${SRCDIR}/Objects.cpp ${SRCDIR}/pack.c ${SRCDIR}/Person.cpp ${SRCDIR}/private.c ${SRCDIR}/Quaternions.cpp ${SRCDIR}/Skeleton.cpp ${SRCDIR}/Skybox.cpp ${SRCDIR}/Sprite.cpp ${SRCDIR}/Terrain.cpp ${SRCDIR}/Texture.cpp ${SRCDIR}/Text.cpp ${SRCDIR}/TGALoader.cpp ${SRCDIR}/unpack.c ${SRCDIR}/Weapons.cpp ${SRCDIR}/OpenGL_Windows.cpp ${SRCDIR}/openal_wrapper.cpp ${SRCDIR}/Input.cpp ${SRCDIR}/Settings.cpp ${SRCDIR}/Stereo.cpp ${SRCDIR}/Animation.cpp ${SRCDIR}/Sounds.cpp ${SRCDIR}/Awards.cpp ) set(LUGARU_H ${SRCDIR}/Frustum.h ${SRCDIR}/Account.h ${SRCDIR}/Game.h ${SRCDIR}/Lights.h ${SRCDIR}/Models.h ${SRCDIR}/Objects.h ${SRCDIR}/Person.h ${SRCDIR}/PhysicsMath.h ${SRCDIR}/Quaternions.h ${SRCDIR}/Random.h ${SRCDIR}/Skeleton.h ${SRCDIR}/Skybox.h ${SRCDIR}/Sprite.h ${SRCDIR}/TGALoader.h ${SRCDIR}/Terrain.h ${SRCDIR}/Texture.h ${SRCDIR}/Text.h ${SRCDIR}/Weapons.h ${SRCDIR}/Input.h ${SRCDIR}/alstubs.h ${SRCDIR}/binio.h ${SRCDIR}/openal_wrapper.h ${SRCDIR}/gamegl.h ${SRCDIR}/glstubs.h ${SRCDIR}/private.h ${SRCDIR}/Settings.h ${SRCDIR}/Stereo.h ${SRCDIR}/Animation.h ${SRCDIR}/Animation.def ${SRCDIR}/Sounds.h ${SRCDIR}/Sounds.def ) if(UNIX) set(LUGARU_SRCS ${LUGARU_SRCS} ${SRCDIR}/MacCompatibility.cpp ) set(LUGARU_H ${LUGARU_H} ${SRCDIR}/MacCompatibility.h ) endif(UNIX) if(MSVC) # MSVC non-C99 support biting us hard set(LUGARU_H ${LUGARU_H} ${DEPDIR}/msinttypes/stdint.h ${DEPDIR}/msinttypes/inttypes.h ) endif(MSVC) if(WIN32) if(CMAKE_CROSSCOMPILING) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj COMMAND i686-pc-mingw32-windres -I${SRCDIR}/win-res -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj -i${SRCDIR}/win-res/Lugaru.rc DEPENDS ${SRCDIR}/win-res/Lugaru.rc ) endif(CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING) if(MSVC) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj COMMAND rc -I${SRCDIR}/win-res -fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj ${SRCDIR}/win-res/Lugaru.rc DEPENDS ${SRCDIR}/win-res/Lugaru.rc ) endif(MSVC) if(MINGW) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj COMMAND windres -I${SRCDIR}/win-res -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj -i${SRCDIR}/win-res/Lugaru.rc DEPENDS ${SRCDIR}/win-res/Lugaru.rc ) endif(MINGW) endif(NOT CMAKE_CROSSCOMPILING) # !!! FIXME: get rid of this. set(LUGARU_SRCS ${LUGARU_SRCS} ${SRCDIR}/WinDefs.cpp) set(LUGARU_H ${LUGARU_H} ${SRCDIR}/WinDefs.h ${SRCDIR}/win-res/resource.h) endif(WIN32) if (APPLE) set(PLATFORM_LIBS "-framework Carbon -framework Cocoa -framework OpenGL -framework OpenAL") endif (APPLE) # Deal with dependencies... find_package(OpenGL REQUIRED) # force this include dir no matter what on Windows, so we get sane headers. if(NOT WIN32) option (LUGARU_FORCE_INTERNAL_OPENGL "Force internal OpenGL headers, even if there's a system version" True) if (LUGARU_FORCE_INTERNAL_OPENGL) include_directories("${DEPDIR}/OpenGL") endif (LUGARU_FORCE_INTERNAL_OPENGL) endif(NOT WIN32) if(WIN32) include_directories("${DEPDIR}/OpenGL") endif(WIN32) if(MSVC) # More Visual Studio annoyances include_directories("${DEPDIR}/msinttypes") endif(MSVC) option (LUGARU_FORCE_INTERNAL_OPENAL "Force internal libOpenAL, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_OPENAL) find_package(OpenAL REQUIRED) else(NOT LUGARU_FORCE_INTERNAL_OPENAL) set(OPENAL_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_OPENAL) if (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL) message(STATUS "Using internal copy of OpenAL") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OpenAL") set(OPENALDIR "${DEPDIR}/OpenAL") set(OPENAL_INCLUDE_DIR "${OPENALDIR}/include/AL") set(OPENAL_LIBRARY "") if (WIN32) set(LUGARU_HAS_INTERNAL_OPENAL True) if (MSVC80) set(OPENAL_LIBRARY ${OPENALDIR}/lib/win32/msvc2005/OpenAL32.lib ) endif (MSVC80) if (MSVC90) set(OPENAL_LIBRARY ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.lib ) endif (MSVC90) if (MINGW) set(OPENAL_LIBRARY ${OPENALDIR}/lib/win32/mingw/libOpenAL32.dll.a ) endif (MINGW) endif(WIN32) if (NOT LUGARU_HAS_INTERNAL_OPENAL) message(ERROR "We don't have a prebuilt OpenAL for this platform.") endif (NOT LUGARU_HAS_INTERNAL_OPENAL) endif (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL) option (LUGARU_FORCE_INTERNAL_SDL "Force internal libSDL, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_SDL) find_package(SDL) else(NOT LUGARU_FORCE_INTERNAL_SDL) set(SDL_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_SDL) if (NOT SDL_FOUND) message(STATUS "Using internal copy of SDL") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} SDL") set(SDLDIR "${DEPDIR}/SDL12") set(SDL_INCLUDE_DIR "${SDLDIR}/include") set(SDL_LIBRARY "") if (APPLE) set(LUGARU_HAS_INTERNAL_SDL True) set(SDL_LIBRARY ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib ${SDLDIR}/lib/macosx/libSDLmain-osx.a ) endif (APPLE) if (WIN32) set(LUGARU_HAS_INTERNAL_SDL True) if (MSVC80) set(SDL_LIBRARY ${SDLDIR}/lib/win32/msvc2005/SDLmain.lib ${SDLDIR}/lib/win32/msvc2005/SDL.lib ) endif (MSVC80) if (MSVC90) set(SDL_LIBRARY ${SDLDIR}/lib/win32/msvc2008/SDLmain.lib ${SDLDIR}/lib/win32/msvc2008/SDL.lib ) endif (MSVC90) if (MINGW) set(SDL_LIBRARY "mingw32" ${SDLDIR}/lib/win32/mingw/libSDLmain.a ${SDLDIR}/lib/win32/mingw/libSDL.dll.a "-mwindows" ) endif (MINGW) endif (WIN32) if (NOT LUGARU_HAS_INTERNAL_SDL) message(ERROR "We don't have a prebuilt SDL for this platform.") endif (NOT LUGARU_HAS_INTERNAL_SDL) endif (NOT SDL_FOUND) option (LUGARU_FORCE_INTERNAL_PNG "Force internal libPNG, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_PNG) find_package(PNG) else(NOT LUGARU_FORCE_INTERNAL_PNG) set(PNG_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_PNG) if (NOT PNG_FOUND) message(STATUS "Using internal copy of libpng") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} PNG") set(PNGDIR "${DEPDIR}/libpng") set(PNG_INCLUDE_DIR "${PNGDIR}") set(PNG_LIBRARY "") set(LUGARU_SRCS ${LUGARU_SRCS} ${PNGDIR}/png.c ${PNGDIR}/pngerror.c ${PNGDIR}/pngget.c ${PNGDIR}/pngmem.c ${PNGDIR}/pngpread.c ${PNGDIR}/pngread.c ${PNGDIR}/pngrio.c ${PNGDIR}/pngrtran.c ${PNGDIR}/pngrutil.c ${PNGDIR}/pngset.c ${PNGDIR}/pngtrans.c ${PNGDIR}/pngwio.c ${PNGDIR}/pngwrite.c ${PNGDIR}/pngwtran.c ${PNGDIR}/pngwutil.c ) endif (NOT PNG_FOUND) option (LUGARU_FORCE_INTERNAL_JPEG "Force internal libJPEG, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_JPEG) find_package(JPEG) else(NOT LUGARU_FORCE_INTERNAL_JPEG) set(JPEG_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_JPEG) if (NOT JPEG_FOUND) message(STATUS "Using internal copy of libjpeg") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} JPEG") set(JPEGDIR "${DEPDIR}/libjpeg") set(JPEG_INCLUDE_DIR "${JPEGDIR}") set(JPEG_LIBRARY "") set(LUGARU_SRCS ${LUGARU_SRCS} ${JPEGDIR}/jdapistd.c ${JPEGDIR}/jdmaster.c ${JPEGDIR}/jdapimin.c ${JPEGDIR}/jcapimin.c ${JPEGDIR}/jdmerge.c ${JPEGDIR}/jdatasrc.c ${JPEGDIR}/jdatadst.c ${JPEGDIR}/jdcoefct.c ${JPEGDIR}/jdcolor.c ${JPEGDIR}/jddctmgr.c ${JPEGDIR}/jdhuff.c ${JPEGDIR}/jdinput.c ${JPEGDIR}/jdmainct.c ${JPEGDIR}/jdmarker.c ${JPEGDIR}/jdpostct.c ${JPEGDIR}/jdsample.c ${JPEGDIR}/jdtrans.c ${JPEGDIR}/jerror.c ${JPEGDIR}/jidctflt.c ${JPEGDIR}/jidctfst.c ${JPEGDIR}/jidctint.c ${JPEGDIR}/jmemmgr.c ${JPEGDIR}/jutils.c ${JPEGDIR}/jmemnobs.c ${JPEGDIR}/jquant1.c ${JPEGDIR}/jquant2.c ${JPEGDIR}/jcomapi.c ${JPEGDIR}/jcmarker.c ${JPEGDIR}/jcapistd.c ${JPEGDIR}/jcparam.c ${JPEGDIR}/jcinit.c ${JPEGDIR}/jcdctmgr.c ${JPEGDIR}/jccoefct.c ${JPEGDIR}/jcmainct.c ${JPEGDIR}/jfdctflt.c ${JPEGDIR}/jfdctint.c ${JPEGDIR}/jfdctfst.c ${JPEGDIR}/jchuff.c ${JPEGDIR}/jcsample.c ${JPEGDIR}/jcmaster.c ${JPEGDIR}/jccolor.c ${JPEGDIR}/jcprepct.c ${JPEGDIR}/jcarith.c ${JPEGDIR}/jdarith.c ${JPEGDIR}/jaricom.c ) endif (NOT JPEG_FOUND) option (LUGARU_FORCE_INTERNAL_ZLIB "Force internal zlib, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_ZLIB) find_package(ZLIB) else(NOT LUGARU_FORCE_INTERNAL_ZLIB) set(ZLIB_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_ZLIB) if (NOT ZLIB_FOUND) message(STATUS "Using internal copy of zlib") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} ZLIB") set(ZLIBDIR "${DEPDIR}/zlib") set(ZLIB_INCLUDE_DIR "${ZLIBDIR}") set(ZLIB_LIBRARIES "") set(LUGARU_SRCS ${LUGARU_SRCS} ${ZLIBDIR}/adler32.c ${ZLIBDIR}/compress.c ${ZLIBDIR}/crc32.c ${ZLIBDIR}/deflate.c ${ZLIBDIR}/infback.c ${ZLIBDIR}/inffast.c ${ZLIBDIR}/inflate.c ${ZLIBDIR}/inftrees.c ${ZLIBDIR}/trees.c ${ZLIBDIR}/uncompr.c ${ZLIBDIR}/zutil.c ) endif (NOT ZLIB_FOUND) option (LUGARU_FORCE_INTERNAL_GLU "Force internal libGLU, even if there's a system version" False) if (LUGARU_FORCE_INTERNAL_GLU) set(OPENGL_GLU_FOUND False) endif (LUGARU_FORCE_INTERNAL_GLU) if (NOT OPENGL_GLU_FOUND) message(STATUS "Using internal copy of libGLU") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU") set(GLUDIR "${DEPDIR}/GLU") set(GLU_INCLUDE_DIR "${GLUDIR}") set(GLU_LIBRARY "") set(LUGARU_SRCS ${LUGARU_SRCS} ${GLUDIR}/dict.c ${GLUDIR}/geom.c ${GLUDIR}/memalloc.c ${GLUDIR}/mesh.c ${GLUDIR}/mipmap.c ${GLUDIR}/normal.c ${GLUDIR}/priorityq.c ${GLUDIR}/render.c ${GLUDIR}/sweep.c ${GLUDIR}/tess.c ${GLUDIR}/tessmono.c ${GLUDIR}/util.c ) endif (NOT OPENGL_GLU_FOUND) option (LUGARU_FORCE_INTERNAL_VORBIS "Force internal Vorbis, even if there's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_VORBIS) find_package(OggVorbis) else(NOT LUGARU_FORCE_INTERNAL_VORBIS) set(OGGVORBIS_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_VORBIS) if (NOT OGGVORBIS_FOUND) message(STATUS "Using internal copy of Ogg Vorbis") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis") set(OGGDIR "${DEPDIR}/libogg") set(OGG_INCLUDE_DIR "${OGGDIR}/include") set(OGG_LIBRARY "") set(VORBISDIR "${DEPDIR}/libvorbis") set(VORBISFILE_INCLUDE_DIR "${VORBISDIR}/include") set(VORBISFILE_LIBRARY "") set(LUGARU_SRCS ${LUGARU_SRCS} ${OGGDIR}/src/bitwise.c ${OGGDIR}/src/framing.c ${VORBISDIR}/lib/analysis.c ${VORBISDIR}/lib/bitrate.c ${VORBISDIR}/lib/block.c ${VORBISDIR}/lib/codebook.c ${VORBISDIR}/lib/envelope.c ${VORBISDIR}/lib/floor0.c ${VORBISDIR}/lib/floor1.c ${VORBISDIR}/lib/info.c ${VORBISDIR}/lib/lpc.c ${VORBISDIR}/lib/lsp.c ${VORBISDIR}/lib/mapping0.c ${VORBISDIR}/lib/mdct.c ${VORBISDIR}/lib/psy.c ${VORBISDIR}/lib/registry.c ${VORBISDIR}/lib/res0.c ${VORBISDIR}/lib/sharedbook.c ${VORBISDIR}/lib/smallft.c ${VORBISDIR}/lib/synthesis.c ${VORBISDIR}/lib/vorbisfile.c ${VORBISDIR}/lib/window.c ) endif (NOT OGGVORBIS_FOUND) include_directories( ${OPENAL_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLU_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${VORBISFILE_INCLUDE_DIR} ${OGG_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/Source ) set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS}) if(WIN32) add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj) else(WIN32) add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) endif(WIN32) target_link_libraries(lugaru ${LUGARU_LIBS}) if(WIN32) add_definitions(-DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=) else(WIN32) add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=) endif(WIN32) # Install target if(APPLE) set(APPS_ROOT "${CMAKE_INSTALL_PREFIX}/Lugaru.app") set(APPS_BIN "${APPS_ROOT}/Contents/MacOS") set(APPS_DATA "${APPS_ROOT}/Contents/Resources") endif(APPLE) if(WIN32) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX}) if(MSVC80) install(FILES ${SDLDIR}/lib/win32/msvc2005/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) install(FILES ${OPENALDIR}/lib/win32/msvc2005/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(MSVC80) if(MSVC90) install(FILES ${SDLDIR}/lib/win32/msvc2008/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) install(FILES ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(MSVC90) if(MINGW) install(FILES ${SDLDIR}/lib/win32/mingw/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) install(FILES ${OPENALDIR}/lib/win32/mingw/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(MINGW) else(WIN32) if(APPLE) set(CMAKE_INSTALL_PREFIX "${APPS_BIN}") install(FILES ${SRCDIR}/mac-res/lugaru.icns DESTINATION ${APPS_DATA}) install(FILES ${SRCDIR}/mac-res/Info.plist DESTINATION ${APPS_ROOT}/Contents) endif(APPLE) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX}) if(APPLE AND LUGARU_HAS_INTERNAL_SDL) install(FILES ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(APPLE AND LUGARU_HAS_INTERNAL_SDL) endif(WIN32) if(NOT APPLE) install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(NOT APPLE) if(APPLE) install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${APPS_ROOT}) endif(APPLE) if (LUGARU_MISSING_DEPS) message(STATUS "Using our copy of these libs: ${LUGARU_MISSING_DEPS}") endif (LUGARU_MISSING_DEPS) lugaru-0~20110520.1+hge4354.orig/Source/0000755000000000000000000000000011571222446015642 5ustar rootrootlugaru-0~20110520.1+hge4354.orig/Source/Person.cpp0000644000000000000000000076751211571222446017636 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /**> HEADER FILES <**/ #include "Person.h" #include "openal_wrapper.h" #include "Animation.h" #include "Sounds.h" #include "Awards.h" #include "Game.h" extern float multiplier; extern Terrain terrain; extern float gravity; extern int environment; extern int detail; extern FRUSTUM frustum; extern XYZ viewer; extern float realmultiplier; extern int slomo; extern float slomodelay; extern bool cellophane; extern float texdetail; extern float realtexdetail; extern GLubyte bloodText[512*512*3]; extern GLubyte wolfbloodText[512*512*3]; extern int bloodtoggle; extern Objects objects; extern bool osx; extern bool autoslomo; extern float camerashake; extern float woozy; extern float viewdistance; extern float blackout; extern int difficulty; extern bool decals; extern float fadestart; extern bool freeze; extern bool winfreeze; extern float flashamount,flashr,flashg,flashb; extern int flashdelay; extern bool showpoints; extern bool immediate; extern int test; extern bool tilt2weird; extern bool tiltweird; extern bool midweird; extern bool proportionweird; extern bool vertexweird[6]; extern XYZ envsound[30]; extern float envsoundvol[30]; extern float envsoundlife[30]; extern int numenvsounds; extern int tutoriallevel; extern float smoketex; extern int tutorialstage; extern bool reversaltrain; extern bool canattack; extern bool cananger; extern float damagedealt; extern int hostile; extern float hostiletime; extern int indialogue; extern bool gamestarted; Person player[maxplayers]; void Person::CheckKick() { if (!(hasvictim && (targetanimation == rabbitkickanim && victim && victim != this && currentframe >= 2 && currentanimation == rabbitkickanim) && (findDistancefast(&coords,&victim->coords) < 1.2) && (!victim->skeleton.free))) return; if (animation[victim->targetanimation].height!=lowheight) { float damagemult = (creature == wolftype ? 2.5 : 1.) * power * power; XYZ relative = velocity; relative.y=0; Normalise(&relative); victim->spurt=1; DoBlood(.2,250); if(tutoriallevel!=1) emit_sound_at(heavyimpactsound, victim->coords); victim->RagDoll(0); for(int i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*120*damagemult; } victim->Puff(neck); victim->DoDamage(100*damagemult/victim->protectionhigh); if(id==0)camerashake+=.4; target=0; currentframe=3; targetanimation=backflipanim; targetframe=4; velocity=facing*-10; velocity.y=5; skeleton.free=0; if(id==0) resume_stream(whooshsound); award_bonus(id, cannon); } else if (victim->isCrouch()) { targetanimation=rabbitkickreversedanim; currentanimation=rabbitkickreversedanim; victim->currentanimation=rabbitkickreversalanim; victim->targetanimation=rabbitkickreversalanim; targettilt2=0; currentframe=0; targetframe=1; target=0; velocity=0; victim->oldcoords=victim->coords; coords=victim->coords; victim->targetrotation=targetrotation; victim->victim=this; } } void Person::CatchFire(){ XYZ flatfacing,flatvelocity; int howmany; for(int i=0;i<10;i++){ howmany=abs(Random()%(skeleton.num_joints)); if(!skeleton.free)flatvelocity=velocity; if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity; if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords; if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords; Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, 2, 1); } onfiredelay=0.5; emit_sound_at(firestartsound, coords); emit_stream_at(stream_firesound, coords); flamedelay=0; onfire=1; } int Person::getIdle(){ if(indialogue!=-1&&howactive==typeactive&&creature==rabbittype)return talkidleanim; if(hasvictim&&victim!=this/*||(id==0&&attackkeydown)*/)if(/*(id==0&&attackkeydown)||*/(!victim->dead&&victim->aitype!=passivetype&&victim->aitype!=searchtype&&aitype!=passivetype&&aitype!=searchtype&&victim->idweaponactive!=-1) return swordfightidlebothanim; if(weapons[weaponids[weaponactive]].getType()==sword) return swordfightidleanim; if(weapons[weaponids[weaponactive]].getType()==staff) return swordfightidleanim; } if(aitype!=playercontrolled&&stunned<=0&&creature!=wolftype&&!pause)return fightsidestep; } if((damage>permanentdamage||damage>damagetolerance*.8||deathbleeding>0)&&creature!=wolftype)return hurtidleanim; if(howactive==typesitting)return sitanim; if(howactive==typesittingwall)return sitwallanim; if(howactive==typesleeping)return sleepanim; if(howactive==typedead1)return dead1anim; if(howactive==typedead2)return dead2anim; if(howactive==typedead3)return dead3anim; if(howactive==typedead4)return dead4anim; if(creature==rabbittype)return bounceidleanim; if(creature==wolftype)return wolfidle; return 0; } int Person::getCrouch(){ if(creature==rabbittype)return crouchanim; if(creature==wolftype)return wolfcrouchanim; return 0; } int Person::getRun(){ if(creature==rabbittype&&(!superruntoggle||weaponactive!=-1))return runanim; if(creature==wolftype&&(!superruntoggle))return wolfrunanim; if(creature==rabbittype&&(superruntoggle&&weaponactive==-1))return rabbitrunninganim; if(creature==wolftype&&(superruntoggle))return wolfrunninganim; return 0; } int Person::getStop(){ if(creature==rabbittype)return stopanim; if(creature==wolftype)return wolfstopanim; return 0; } int Person::getLanding(){ if(creature==rabbittype)return landanim; if(creature==wolftype)return wolflandanim; return 0; } int Person::getLandhard(){ if(creature==rabbittype)return landhardanim; if(creature==wolftype)return wolflandhardanim; return 0; } static void SolidHitBonus(int playerid) { if (bonustime < 1.5 && bonus >= solidhit && bonus <= megacombo) award_bonus(playerid, bonus == megacombo ? bonus : bonus + 1); else award_bonus(playerid, solidhit); } void Person::DoBlood(float howmuch,int which){ static int bleedxint,bleedyint; static XYZ bloodvel; //if(howmuch&&id==0)blooddimamount=1; if(bloodtoggle&&tutoriallevel!=1){ if(bleeding<=0&&spurt){ spurt=0; for(int i=0;i<3;i++){ bloodvel=0; if(!skeleton.free){ bloodvel.z=10; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; } if(skeleton.free){ bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0); } if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; if(skeleton.free){ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1); } if(!skeleton.free){ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1); } } if(Random()%2==0) for(int i=0;i<3;i++){ if(Random()%2!=0){ bloodvel=0; if(skeleton.free) { bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0); bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; } else { bloodvel.z=10; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; } bloodvel*=.2; if(skeleton.free){ Sprite::MakeSprite(splintersprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1); } else { Sprite::MakeSprite(splintersprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); } Sprite::setLastSpriteSpecial(3); } } } if(decals){ bleeding=howmuch+(float)abs(Random()%100)/200-.25; bleedxint=0; bleedyint=0; if(creature==rabbittype) while(bloodText[bleedxint*512*3+bleedyint*3+0]>which+4||bloodText[bleedxint*512*3+bleedyint*3+0]500||bleedyint>500){ bleedxint=abs(Random()%512); bleedyint=abs(Random()%512); } if(creature==wolftype) while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]500||bleedyint>500){ bleedxint=abs(Random()%512); bleedyint=abs(Random()%512); } bleedy=bleedxint; bleedx=bleedyint; bleedy/=realtexdetail; bleedx/=realtexdetail; direction=abs(Random()%2)*2-1; } } if(bleeding>2)bleeding=2; } void Person::DoBloodBig(float howmuch,int which){ static int bleedxint,bleedyint,i,j; static XYZ bloodvel; if(howmuch&&id==0)blooddimamount=1; if(tutoriallevel!=1||id==0) if(aitype!=playercontrolled&&howmuch>0){ int whichsound=-1; if(creature==wolftype){ int i=abs(Random()%2); if(i==0)whichsound=snarlsound; if(i==1)whichsound=snarl2sound; envsound[numenvsounds]=coords; envsoundvol[numenvsounds]=16; envsoundlife[numenvsounds]=.4; numenvsounds++; } if(creature==rabbittype){ int i=abs(Random()%2); if(i==0)whichsound=rabbitpainsound; if(i==1&&howmuch>=2)whichsound=rabbitpain1sound; envsound[numenvsounds]=coords; envsoundvol[numenvsounds]=16; envsoundlife[numenvsounds]=.4; numenvsounds++; //if(i==2)whichsound=rabbitpain2sound; } if(whichsound!=-1) emit_sound_at(whichsound, coords); } if(id==0&&howmuch>0){ flashamount=.5; flashr=1; flashg=0; flashb=0; flashdelay=0; } if(bloodtoggle&&decals&&tutoriallevel!=1){ if(bleeding<=0&&spurt){ spurt=0; for(int i=0;i<3;i++){ bloodvel=0; if(!skeleton.free){ bloodvel.z=10; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; } if(skeleton.free){ bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0); } if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; if(skeleton.free){ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1); } if(!skeleton.free){ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1); } } } int offsetx=0,offsety=0; if(which==225){ offsety=Random()%40; offsetx=abs(Random()%60); } if(which==190||which==185){ offsety=Random()%40; offsetx=abs(Random()%100)-20; } if(which==175){ offsety=Random()%10; offsetx=Random()%10; } if(which==170){ offsety=Random()%20; offsetx=Random()%20; } if(which==220||which==215){ offsetx=20; } int startx=512; int starty=512; int endx=0; int endy=0; GLubyte color; if(creature==rabbittype) for(i=0;i<512;i++){ for(j=0;j<512;j++){ if(bloodText[i*512*3+j*3+0]<=which+4&&bloodText[i*512*3+j*3+0]>=which-4){ if(iendx)endx=i; if(j>endy)endy=j; } } } if(creature==wolftype) for(i=0;i<512;i++){ for(j=0;j<512;j++){ if(wolfbloodText[i*512*3+j*3+0]<=which+4&&wolfbloodText[i*512*3+j*3+0]>=which-4){ if(iendx)endx=i; if(j>endy)endy=j; } } } startx+=offsetx; endx+=offsetx; starty+=offsety; endy+=offsety; if(startx<0)startx=0; if(starty<0)starty=0; if(endx>512-1)endx=512-1; if(endy>512-1)endy=512-1; if(endx=which-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } } } if(creature==wolftype) for(i=startx;i=which-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } } } glBindTexture(GL_TEXTURE_2D,skeleton.drawmodel.textureptr); DoMipmaps(); bleedxint=0; bleedyint=0; if(creature==rabbittype) while(bloodText[bleedxint*512*3+bleedyint*3+0]>which+4||bloodText[bleedxint*512*3+bleedyint*3+0]500||bleedyint>500){ bleedxint=abs(Random()%512); bleedyint=abs(Random()%512); } if(creature==wolftype) while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]500||bleedyint>500){ bleedxint=abs(Random()%512); bleedyint=abs(Random()%512); } bleedy=bleedxint+offsetx; bleedx=bleedyint+offsety; bleedy/=realtexdetail; bleedx/=realtexdetail; if(bleedx<0)bleedx=0; if(bleedy<0)bleedy=0; if(bleedx>skeleton.skinsize-1)bleedx=skeleton.skinsize-1; if(bleedy>skeleton.skinsize-1)bleedy=skeleton.skinsize-1; direction=abs(Random()%2)*2-1; } bleeding=howmuch+(float)abs(Random()%100)/200-.25; deathbleeding+=bleeding; bloodloss+=bleeding*3; if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodloss2)bleeding=2; } bool Person::DoBloodBigWhere(float howmuch,int which, XYZ where){ static int i,j; static XYZ bloodvel; static XYZ startpoint,endpoint,colpoint,movepoint; static float rotationpoint; static int whichtri; static XYZ p1,p2,p3,p0; static XYZ N,temp; XYZ bary; XYZ gxx,gyy; float coordsx,coordsy; float total; if(bloodtoggle&&decals&&tutoriallevel!=1){ where-=coords; if(!skeleton.free)where=DoRotation(where,0,-rotation,0); //where=scale; startpoint=where; startpoint.y+=100; endpoint=where; endpoint.y-=100; movepoint=0; rotationpoint=0; whichtri=skeleton.drawmodel.LineCheck(&startpoint,&endpoint, &colpoint, &movepoint, &rotationpoint); if(whichtri!=-1){ p0=colpoint; p1=skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[0]]; p2=skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[1]]; p3=skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[2]]; /* CrossProduct(p2-p1,p3-p1,&N); CrossProduct(p0-p1,p3-p1,&temp); s = dotproduct(&temp,&N)/findLength(&N); CrossProduct(p2-p1,p1-p0,&temp); t = dotproduct(&temp,&N)/findLength(&N); r = 1 - (s + t);*/ bary.x=findDistancefast(&p0,&p1); bary.y=findDistancefast(&p0,&p2); bary.z=findDistancefast(&p0,&p3); total=bary.x+bary.y+bary.z; bary.x/=total; bary.y/=total; bary.z/=total; bary.x=1-bary.x; bary.y=1-bary.y; bary.z=1-bary.z; total=bary.x+bary.y+bary.z; bary.x/=total; bary.y/=total; bary.z/=total; gxx.x=skeleton.drawmodel.Triangles[whichtri].gx[0]; gxx.y=skeleton.drawmodel.Triangles[whichtri].gx[1]; gxx.z=skeleton.drawmodel.Triangles[whichtri].gx[2]; gyy.x=skeleton.drawmodel.Triangles[whichtri].gy[0]; gyy.y=skeleton.drawmodel.Triangles[whichtri].gy[1]; gyy.z=skeleton.drawmodel.Triangles[whichtri].gy[2]; coordsx=skeleton.drawmodel.Triangles[whichtri].gx[0]*bary.x+skeleton.drawmodel.Triangles[whichtri].gx[1]*bary.y+skeleton.drawmodel.Triangles[whichtri].gx[2]*bary.z; coordsy=skeleton.drawmodel.Triangles[whichtri].gy[0]*bary.x+skeleton.drawmodel.Triangles[whichtri].gy[1]*bary.y+skeleton.drawmodel.Triangles[whichtri].gy[2]*bary.z; //coordsx=skeleton.drawmodel.Triangles[whichtri].gx[1]; //coordsy=skeleton.drawmodel.Triangles[whichtri].gy[1]; if(bleeding<=0&&spurt){ spurt=0; for(int i=0;i<3;i++){ bloodvel=0; if(!skeleton.free){ bloodvel.z=10; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; } if(skeleton.free){ bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0); } if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; if(skeleton.free){ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1); } if(!skeleton.free){ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1); } } } int offsetx=0,offsety=0; /*if(which==225){ offsety=Random()%40; offsetx=abs(Random()%120); } if(which==220||which==215){ offsety=Random()%20; offsetx=abs(Random()%80); }*/ //which=220; offsetx=(1+coordsy)*512-291; offsety=coordsx*512-437; int startx=512; int starty=512; int endx=0; int endy=0; GLubyte color; if(creature==rabbittype) for(i=0;i<512;i++){ for(j=0;j<512;j++){ if(bloodText[i*512*3+j*3+0]<=which+4&&bloodText[i*512*3+j*3+0]>=which-4){ if(iendx)endx=i; if(j>endy)endy=j; } } } if(creature==wolftype) for(i=0;i<512;i++){ for(j=0;j<512;j++){ if(wolfbloodText[i*512*3+j*3+0]<=which+4&&wolfbloodText[i*512*3+j*3+0]>=which-4){ if(iendx)endx=i; if(j>endy)endy=j; } } } startx+=offsetx; endx+=offsetx; starty+=offsety; endy+=offsety; if(startx<0)startx=0; if(starty<0)starty=0; if(endx>512-1)endx=512-1; if(endy>512-1)endy=512-1; if(endx=which-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } else if(bloodText[(i*texdetailint-offsetx)*512*3+(j*texdetailint-offsety)*3+0]<=160+4&&bloodText[(i*texdetailint-offsetx)*512*3+(j*texdetailint-offsety)*3+0]>=160-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } } } if(creature==wolftype) for(i=startx;i=which-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } else if(wolfbloodText[(i*texdetailint-offsetx)*512*3+(j*texdetailint-offsety)*3+0]<=160+4&&wolfbloodText[(i*texdetailint-offsetx)*512*3+(j*texdetailint-offsety)*3+0]>=160-4){ color=Random()%85+170; where=i*skeleton.skinsize*3+j*3; if(skeleton.skinText[where+0]>color/2)skeleton.skinText[where+0]=color/2; skeleton.skinText[where+1]=0; skeleton.skinText[where+2]=0; } } } glBindTexture(GL_TEXTURE_2D,skeleton.drawmodel.textureptr); DoMipmaps(); bleedy=(1+coordsy)*512; bleedx=coordsx*512; bleedy/=realtexdetail; bleedx/=realtexdetail; if(bleedx<0)bleedx=0; if(bleedy<0)bleedy=0; if(bleedx>skeleton.skinsize-1)bleedx=skeleton.skinsize-1; if(bleedy>skeleton.skinsize-1)bleedy=skeleton.skinsize-1; direction=abs(Random()%2)*2-1; } if(whichtri==-1)return 0; } bleeding=howmuch+(float)abs(Random()%100)/200-.25; deathbleeding+=bleeding; bloodloss+=bleeding*3; if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodloss2)bleeding=2; return 1; } void Person::Reverse() { if (!((victim->aitype == playercontrolled || hostiletime > 1 || staggerdelay <= 0) && victim->targetanimation != jumpupanim && victim->targetanimation != jumpdownanim && (tutoriallevel != 1 || cananger) && hostile)) return; if (normaldotproduct (victim->facing, victim->coords-coords) > 0 && (victim->id != 0 || difficulty >= 2) && (creature != wolftype || victim->creature == wolftype)) return; if(targetanimation==sweepanim){ targetanimation=sweepreversedanim; currentanimation=sweepreversedanim; victim->currentanimation=sweepreversalanim; victim->targetanimation=sweepreversalanim; } if(targetanimation==spinkickanim){ targetanimation=spinkickreversedanim; currentanimation=spinkickreversedanim; victim->currentanimation=spinkickreversalanim; victim->targetanimation=spinkickreversalanim; } if(targetanimation==upunchanim||targetanimation==rabbittacklinganim){ if(targetanimation==rabbittacklinganim){ currentframe=6; targetframe=7; victim->currentframe=6; victim->targetframe=7; } targetanimation=upunchreversedanim; currentanimation=upunchreversedanim; victim->currentanimation=upunchreversalanim; victim->targetanimation=upunchreversalanim; } if(targetanimation==staffhitanim&&findDistancefast(&victim->coords,&coords)<2&&((victim->id==0&&victim->crouchkeydown)||Random()%4==0)){ if(victim->weaponactive!=-1){ victim->throwtogglekeydown=1; weapons[victim->weaponids[0]].owner=-1; weapons[victim->weaponids[0]].velocity=victim->velocity*.2; if(weapons[victim->weaponids[0]].velocity.x==0)weapons[victim->weaponids[0]].velocity.x=.1; weapons[victim->weaponids[0]].tipvelocity=weapons[victim->weaponids[0]].velocity; weapons[victim->weaponids[0]].missed=1; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[victim->num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(int j=0;jcurrentanimation=staffhitreversalanim; victim->targetanimation=staffhitreversalanim; } if(targetanimation==staffspinhitanim&&findDistancefast(&victim->coords,&coords)<2&&((victim->id==0&&victim->crouchkeydown)||Random()%2==0)){ if(victim->weaponactive!=-1){ victim->throwtogglekeydown=1; weapons[victim->weaponids[0]].owner=-1; weapons[victim->weaponids[0]].velocity=victim->velocity*.2; if(weapons[victim->weaponids[0]].velocity.x==0)weapons[victim->weaponids[0]].velocity.x=.1; weapons[victim->weaponids[0]].tipvelocity=weapons[victim->weaponids[0]].velocity; weapons[victim->weaponids[0]].missed=1; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[victim->num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(int j=0;jcurrentanimation=staffspinhitreversalanim; victim->targetanimation=staffspinhitreversalanim; } if(targetanimation==swordslashanim&&findDistancefast(&victim->coords,&coords)<2&&((victim->id==0&&victim->crouchkeydown)||Random()%4==0)){ if(victim->weaponactive!=-1){ victim->throwtogglekeydown=1; weapons[victim->weaponids[0]].owner=-1; weapons[victim->weaponids[0]].velocity=victim->velocity*.2; if(weapons[victim->weaponids[0]].velocity.x==0)weapons[victim->weaponids[0]].velocity.x=.1; weapons[victim->weaponids[0]].tipvelocity=weapons[victim->weaponids[0]].velocity; weapons[victim->weaponids[0]].missed=1; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[victim->num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(int j=0;jcurrentanimation=swordslashreversalanim; victim->targetanimation=swordslashreversalanim; } if(targetanimation==knifeslashstartanim&&findDistancefast(&victim->coords,&coords)<2&&(victim->id==0||Random()%4==0)){ if(victim->weaponactive!=-1){ victim->throwtogglekeydown=1; weapons[victim->weaponids[0]].owner=-1; weapons[victim->weaponids[0]].velocity=victim->velocity*.2; if(weapons[victim->weaponids[0]].velocity.x==0)weapons[victim->weaponids[0]].velocity.x=.1; weapons[victim->weaponids[0]].tipvelocity=weapons[victim->weaponids[0]].velocity; weapons[victim->weaponids[0]].missed=1; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[victim->num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(int j=0;jcurrentanimation=knifeslashreversalanim; victim->targetanimation=knifeslashreversalanim; } if(targetanimation!=knifeslashstartanim&&targetanimation!=staffhitanim&&targetanimation!=staffspinhitanim&&targetanimation!=winduppunchanim&&targetanimation!=wolfslapanim&&targetanimation!=swordslashanim&&targetanimation!=swordslashanim){ victim->targettilt2=targettilt2; victim->currentframe=currentframe; victim->targetframe=targetframe; victim->target=target; victim->velocity=0; victim->oldcoords=victim->coords; victim->coords=coords; victim->targetrotation=targetrotation; victim->rotation=targetrotation; victim->victim=this; } if(targetanimation==winduppunchanim){ targetanimation=winduppunchblockedanim; victim->targetanimation=blockhighleftanim; victim->targetframe=1; victim->target=.5; victim->victim=this; victim->targetrotation=targetrotation+180; } if(targetanimation==wolfslapanim){ targetanimation=winduppunchblockedanim; victim->targetanimation=blockhighleftanim; victim->targetframe=1; victim->target=.5; victim->victim=this; victim->targetrotation=targetrotation+180; } if((targetanimation==swordslashanim||targetanimation==staffhitanim||targetanimation==staffspinhitanim)&&victim->weaponactive!=-1){ targetanimation=swordslashparriedanim; parriedrecently=.4; victim->parriedrecently=0; victim->targetanimation=swordslashparryanim; victim->targetframe=1; victim->target=.5; victim->victim=this; victim->targetrotation=targetrotation+180; if(abs(Random()%20)==0||weapons[victim->weaponids[victim->weaponactive]].getType()==knife){ if(victim->weaponactive!=-1){ if(weapons[victim->weaponids[0]].getType()==staff||weapons[weaponids[0]].getType()==staff) { if(weapons[victim->weaponids[0]].getType()==staff) weapons[victim->weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; if(weapons[weaponids[0]].getType()==staff) weapons[weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; emit_sound_at(swordstaffsound, victim->coords); } else{ emit_sound_at(metalhitsound, victim->coords); } } XYZ aim; victim->Puff(righthand); victim->target=0; victim->targetframe=0; victim->targetanimation=staggerbackhighanim; victim->targetrotation=targetrotation+180; victim->target=0; weapons[victim->weaponids[0]].owner=-1; aim=DoRotation(facing,0,90,0)*21; aim.y+=7; weapons[victim->weaponids[0]].velocity=aim*-.2; weapons[victim->weaponids[0]].tipvelocity=aim; weapons[victim->weaponids[0]].missed=1; weapons[victim->weaponids[0]].hitsomething=0; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(int i=0;iweaponids[0]].getType()==staff||weapons[weaponids[0]].getType()==staff){ if(weapons[victim->weaponids[0]].getType()==staff)weapons[victim->weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; if(weapons[weaponids[0]].getType()==staff)weapons[weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; emit_sound_at(swordstaffsound, coords); } else{ emit_sound_at(metalhitsound, coords); } } XYZ aim; Puff(righthand); target=0; targetframe=0; targetanimation=staggerbackhighanim; targetrotation=targetrotation+180; target=0; weapons[weaponids[0]].owner=-1; aim=DoRotation(facing,0,90,0)*21; aim.y+=7; weapons[weaponids[0]].velocity=aim*-.2; weapons[weaponids[0]].tipvelocity=aim; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].missed=1; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=1; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; if(weaponstuck==num_weapons)weaponstuck=0; } weaponactive=-1; for(int i=0;icoords)>.2){ victim->targetanimation=dodgebackanim; victim->targetframe=0; victim->target=0; XYZ rotatetarget; rotatetarget=coords-victim->coords; Normalise(&rotatetarget); victim->targetrotation=-asin(0-rotatetarget.x); victim->targetrotation*=360/6.28; if(rotatetarget.z<0)victim->targetrotation=180-victim->targetrotation; victim->targettilt2=-asin(rotatetarget.y)*360/6.28;//*-70; victim->lastattack3=victim->lastattack2; victim->lastattack2=victim->lastattack; victim->lastattack=victim->targetanimation; } else { victim->targetanimation=sweepanim; victim->targetframe=0; victim->target=0; XYZ rotatetarget; rotatetarget=coords-victim->coords; Normalise(&rotatetarget); victim->targetrotation=-asin(0-rotatetarget.x); victim->targetrotation*=360/6.28; if(rotatetarget.z<0)victim->targetrotation=180-victim->targetrotation; victim->targettilt2=-asin(rotatetarget.y)*360/6.28;//*-70; victim->lastattack3=victim->lastattack2; victim->lastattack2=victim->lastattack; victim->lastattack=victim->targetanimation; } } velocity=0; victim->velocity=0; if(aitype!=playercontrolled)feint=0; if(aitype!=playercontrolled&&Random()%3==0&&escapednum<2&&difficulty==2)feint=1; if(aitype!=playercontrolled&&Random()%5==0&&escapednum<2&&difficulty==1)feint=1; if(aitype!=playercontrolled&&Random()%10==0&&escapednum<2&&difficulty==0)feint=1; if(victim->id==0&&animation[victim->targetanimation].attack==reversal)numreversals++; } void Person::DoDamage(float howmuch){ if(tutoriallevel!=1)damage+=howmuch/power; if(id!=0)damagedealt+=howmuch/power; if(id==0)damagetaken+=howmuch/power; if(id==0&&(bonus==solidhit||bonus==twoxcombo||bonus==threexcombo||bonus==fourxcombo||bonus==megacombo))bonus=0; if(tutoriallevel!=1)permanentdamage+=howmuch/2/power; if(tutoriallevel!=1)superpermanentdamage+=howmuch/4/power; if(permanentdamage>damagetolerance/2&&permanentdamage-howmuchdamagetolerance*.8&&Random()%2&&!deathbleeding)||spurt)DoBlood(1,255); spurt=0; if(id==0)camerashake+=howmuch/100; if(id==0&&((howmuch>50&&damage>damagetolerance/2)))blackout=damage/damagetolerance; if(blackout>1)blackout=1; if(aitype==passivetype&&damagedamagetolerance*2/3&&creature==rabbittype){ if(abs(Random()%2)==0){aitype=gethelptype; lastseentime=12; } else aitype=attacktypecutoff; ally=0; } if(howmuch>damagetolerance*50&&skeleton.free!=2){ XYZ flatvelocity2; XYZ flatfacing2; for(int i=0;idamagetolerance)whichsound=rabbitpain1sound; envsound[numenvsounds]=coords; envsoundvol[numenvsounds]=16; envsoundlife[numenvsounds]=.4; numenvsounds++; //if(i==2)whichsound=rabbitpain2sound; } if(whichsound!=-1){ emit_sound_at(whichsound, coords); } } speechdelay=.3; //if(permanentdamage>=damagetolerance&&howmuch<50)permanentdamage=damagetolerance-1; //if(damage>=damagetolerance&&howmuch<30&&!dead)damage=damagetolerance-1; } void Person::DoHead(){ static XYZ rotatearound; static XYZ facing; static float lookspeed=500; if(!freeze&&!winfreeze){ //head facing targetheadrotation=(float)((int)((0-rotation-targetheadrotation+180)*100)%36000)/100; targetheadrotation2=(float)((int)(targetheadrotation2*100)%36000)/100; while(targetheadrotation>180)targetheadrotation-=360; while(targetheadrotation<-180)targetheadrotation+=360; if(targetheadrotation>160)targetheadrotation2=targetheadrotation2*-1; if(targetheadrotation<-160)targetheadrotation2=targetheadrotation2*-1; if(targetheadrotation>160)targetheadrotation=targetheadrotation-180; if(targetheadrotation<-160)targetheadrotation=targetheadrotation+180; if(targetheadrotation2>120)targetheadrotation2=120; if(targetheadrotation2<-120)targetheadrotation2=-120; if(targetheadrotation>120)targetheadrotation=120; if(targetheadrotation<-120)targetheadrotation=-120; if(!isIdle())targetheadrotation2=0; if(isIdle()){ if(targetheadrotation>80)targetheadrotation=80; if(targetheadrotation<-80)targetheadrotation=-80; if(targetheadrotation2>50)targetheadrotation2=50; if(targetheadrotation2<-50)targetheadrotation2=-50; } if(abs(headrotation-targetheadrotation)targetheadrotation){ headrotation-=multiplier*lookspeed; } else if(headrotationtargetheadrotation2){ headrotation2-=multiplier*lookspeed/2; } else if(headrotation2label==head||skeleton.muscles[i].parent2->label==head)) { skeleton.FindRotationMuscle(i,targetanimation); } } } } void Person::RagDoll(bool checkcollision){ static XYZ change; static int l,i,j; static float speed; if(!skeleton.free){ if(id==0)numfalls++; if(id==0&&isFlip())numflipfail++; escapednum=0; facing=0; facing.z=1; facing=DoRotation(facing,0,rotation,0); skeleton.freetime=0; skeleton.longdead=0; skeleton.free=1; skeleton.broken=0; skeleton.spinny=1; freefall=1; skeleton.freefall=1; if(!isnormal(velocity.x))velocity.x=0; if(!isnormal(velocity.y))velocity.y=0; if(!isnormal(velocity.z))velocity.z=0; if(!isnormal(rotation))rotation=0; if(!isnormal(coords.x))coords=0; if(!isnormal(tilt))tilt=0; if(!isnormal(tilt2))tilt2=0; for(i=0;ianimation[targetanimation].speed[targetframe]){ speed=animation[currentanimation].speed[currentframe]*2; } if(transspeed)speed=transspeed*2; speed*=speedmult; for(i=0;i0){ weapons[weaponids[0]].owner=-1; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].velocity=skeleton.joints[skeleton.jointlabels[righthand]].velocity*scale*-.3; weapons[weaponids[0]].velocity.x+=.01; weapons[weaponids[0]].tipvelocity=skeleton.joints[skeleton.jointlabels[righthand]].velocity*scale; weapons[weaponids[0]].missed=1; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=1; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; if(weaponstuck==num_weapons)weaponstuck=0; } weaponactive=-1; for(i=0;i=1||skiddelay<=0) if(opacity>1) { footvel=0; if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords; if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords; //footpoint.y=coords.y; if(findDistancefast(&footpoint,&viewer))Sprite::MakeSprite(cloudsprite, footpoint,footvel, 1,1,1, .5, .2*opacity); } else if(environment==snowyenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){ footvel=velocity/5; if(footvel.y<.8)footvel.y=.8; if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords; if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords; footpoint.y=terrain.getHeight(footpoint.x,footpoint.z); terrainlight=terrain.getLighting(footpoint.x,footpoint.z); if(findDistancefast(&footpoint,&viewer)=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1; if(!crouchkeydown&&velocity.y>=-15)landhard=0; } if((currentanimation==jumpupanim||targetanimation==jumpdownanim)/*&&velocity.y<40*/&&!isFlip()&&(!isLanding()&&!isLandhard())&&((crouchkeydown&&!crouchtogglekeydown))){ XYZ targfacing; targfacing=0; targfacing.z=1; targfacing=DoRotation(targfacing,0,targetrotation,0); if(normaldotproduct(targfacing,velocity)>=-.3)targetanimation=flipanim; else targetanimation=backflipanim; crouchtogglekeydown=1; targetframe=0; target=0; if(id==0)numflipped++; } if(animation[targetanimation].attack!=reversed)feint=0; if(!crouchkeydown||(isLanding()||isLandhard())||(wasLanding()||wasLandhard())){ crouchtogglekeydown=0; if(aitype==playercontrolled)feint=0; } else { if(!crouchtogglekeydown&&animation[targetanimation].attack==reversed&&aitype==playercontrolled&&(escapednum<2||reversaltrain))feint=1; if(!isFlip())crouchtogglekeydown=1; } if(animation[targetanimation].attack||currentanimation==getupfrombackanim||currentanimation==getupfromfrontanim){ if(detail)normalsupdatedelay=0; } if(target>=1){ if(targetanimation==rollanim&&targetframe==3&&onfire){ onfire=0; emit_sound_at(fireendsound, coords); pause_sound(stream_firesound); deathbleeding=0; } if(targetanimation==rabbittacklinganim&&targetframe==1){ //if(victim->aitype==attacktypecutoff&&Random()%2==0&&victim->stunned<=0&&animation[victim->targetanimation].attack==neutral&&victim->id!=0)Reverse(); if(victim->aitype==attacktypecutoff&&victim->stunned<=0&&victim->surprised<=0&&victim->id!=0)Reverse(); if(targetanimation==rabbittacklinganim&&targetframe==1&&!victim->isCrouch()&&victim->targetanimation!=backhandspringanim){ if(normaldotproduct(victim->facing,facing)>0)victim->targetanimation=rabbittackledbackanim; else victim->targetanimation=rabbittackledfrontanim; victim->targetframe=2; victim->target=0; victim->rotation=rotation; victim->targetrotation=rotation; if(victim->aitype==gethelptype)victim->DoDamage(victim->damagetolerance-victim->damage); //victim->DoDamage(30); if(creature==wolftype){ DoBloodBig(0,255); emit_sound_at(clawslicesound, victim->coords); victim->spurt=1; victim->DoBloodBig(1/victim->armorhead,210); } award_bonus(id, TackleBonus, victim->aitype == gethelptype ? 50 : 0); } } if(!drawtogglekeydown&&drawkeydown&&(weaponactive==-1||num_weapons==1)&&(animation[targetanimation].label[targetframe]||(targetanimation!=currentanimation&¤tanimation==rollanim))&&num_weapons>0&&creature!=wolftype){ if(weapons[weaponids[0]].getType()==knife){ if(weaponactive==-1)weaponactive=0; else if(weaponactive==0)weaponactive=-1; if(weaponactive==-1){ emit_sound_at(knifesheathesound, coords); } if(weaponactive!=-1){ emit_sound_at(knifedrawsound, coords, 128); } } drawtogglekeydown=1; } //Footstep sounds if(tutoriallevel!=1||id==0) if((animation[targetanimation].label[targetframe]&&(animation[targetanimation].label[targetframe]<5||animation[targetanimation].label[targetframe]==8))/*||(targetanimation==rollanim&&targetframe==animation[rollanim].numframes-1)*/){ int whichsound; if(onterrain){ if(terrain.getOpacity(coords.x,coords.z)<.2){ if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound; else whichsound=footstepsound2; if(animation[targetanimation].label[targetframe]==1)FootLand(0,1); if(animation[targetanimation].label[targetframe]==2)FootLand(1,1); if(animation[targetanimation].label[targetframe]==3&&isRun()){ FootLand(1,1); FootLand(0,1); } } if(terrain.getOpacity(coords.x,coords.z)>=.2){ if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3; else whichsound=footstepsound4; } } if(!onterrain){ if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3; else whichsound=footstepsound4; } if(animation[targetanimation].label[targetframe]==4&&(weaponactive==-1||(targetanimation!=knifeslashstartanim&&targetanimation!=knifethrowanim&&targetanimation!=crouchstabanim&&targetanimation!=swordgroundstabanim&&targetanimation!=knifefollowanim))){ if(animation[targetanimation].attack!=neutral){ i=abs(Random()%3); if(i==0)whichsound=lowwhooshsound; if(i==1)whichsound=midwhooshsound; if(i==2)whichsound=highwhooshsound; } if(animation[targetanimation].attack==neutral)whichsound=movewhooshsound; } else if(animation[targetanimation].label[targetframe]==4)whichsound=knifeswishsound; if(animation[targetanimation].label[targetframe]==8&&tutoriallevel!=1)whichsound=landsound2; emit_sound_at(whichsound, coords, 256.); if(id==0) if(whichsound==footstepsound||whichsound==footstepsound2||whichsound==footstepsound3||whichsound==footstepsound4){ envsound[numenvsounds]=coords; if(targetanimation==wolfrunninganim||targetanimation==rabbitrunninganim)envsoundvol[numenvsounds]=15; else envsoundvol[numenvsounds]=6; envsoundlife[numenvsounds]=.4; numenvsounds++; } if(animation[targetanimation].label[targetframe]==3){ whichsound--; emit_sound_at(whichsound, coords, 128.); } } //Combat sounds if(tutoriallevel!=1||id==0) if(speechdelay<=0) if(targetanimation!=crouchstabanim&&targetanimation!=swordgroundstabanim&&targetanimation!=staffgroundsmashanim) if((animation[targetanimation].label[targetframe]&&(animation[targetanimation].label[targetframe]<5||animation[targetanimation].label[targetframe]==8))/*||(targetanimation==rollanim&&targetframe==animation[rollanim].numframes-1)*/){ int whichsound=-1; if(animation[targetanimation].label[targetframe]==4&&aitype!=playercontrolled){ if(animation[targetanimation].attack!=neutral){ i=abs(Random()%4); if(creature==rabbittype){ if(i==0)whichsound=rabbitattacksound; if(i==1)whichsound=rabbitattack2sound; if(i==2)whichsound=rabbitattack3sound; if(i==3)whichsound=rabbitattack4sound; } if(creature==wolftype){ if(i==0)whichsound=barksound; if(i==1)whichsound=bark2sound; if(i==2)whichsound=bark3sound; if(i==3)whichsound=barkgrowlsound; } speechdelay=.3; } //if(animation[targetanimation].attack==neutral)whichsound=movewhooshsound; } //else if(animation[targetanimation].label[targetframe]==4)whichsound=knifeswishsound; //if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2; if(whichsound!=-1){ emit_sound_at(whichsound, coords); } } if((!wasLanding()&&!wasLandhard())&¤tanimation!=getIdle()&&(isLanding()||isLandhard())){ FootLand(0,1); FootLand(1,1); } transspeed=0; currentoffset=targetoffset; targetframe=currentframe; currentanimation=targetanimation; targetframe++; if(targetanimation==removeknifeanim&&animation[targetanimation].label[currentframe]==5){ for(i=0;i=1){ if(weapons[i].getType()!=staff){ emit_sound_at(knifedrawsound, coords, 128.); } weaponactive=0; weapons[i].owner=id; if(num_weapons>0){ weaponids[num_weapons]=weaponids[0]; } num_weapons++; weaponids[0]=i; } } } } if(targetanimation==crouchremoveknifeanim&&animation[targetanimation].label[currentframe]==5){ for(i=0;i1)willwork=0; if((weapons[i].owner==-1)||(hasvictim&&weapons[i].owner==victim->id&&victim->skeleton.free)) if(willwork&&findDistancefastflat(&coords,&weapons[i].position)<3&&weaponactive==-1){ if(findDistancefast(&coords,&weapons[i].position)<1||hasvictim){ bool fleshstuck=false; if(weapons[i].owner!=-1) if(victim->weaponstuck!=-1){ if(victim->weaponids[victim->weaponstuck]==i){ fleshstuck=true; } } if(fleshstuck){ emit_sound_at(fleshstabremovesound, coords, 128.); } else { if(weapons[i].getType()!=staff){ emit_sound_at(knifedrawsound, coords, 128.); } } weaponactive=0; if(weapons[i].owner!=-1){ victim=&player[weapons[i].owner]; if(victim->num_weapons==1)victim->num_weapons=0; else victim->num_weapons=1; //victim->weaponactive=-1; victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; for(int j=0;jskeleton.num_joints;j++){ victim->skeleton.joints[j].velchange=0; victim->skeleton.joints[j].locked=0; } XYZ relative; relative=0; relative.y=10; Normalise(&relative); XYZ footvel,footpoint; footvel=0; footpoint=weapons[i].position; if(victim->weaponstuck!=-1){ if(victim->weaponids[victim->weaponstuck]==i){ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); weapons[i].bloody=2; weapons[i].blooddrip=5; victim->weaponstuck=-1; } } if(victim->num_weapons>0){ if(victim->weaponstuck!=0&&victim->weaponstuck!=-1)victim->weaponstuck=0; if(victim->weaponids[0]==i) victim->weaponids[0]=victim->weaponids[victim->num_weapons]; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*6; victim->skeleton.joints[victim->skeleton.jointlabels[neck]].velocity+=relative*6; victim->skeleton.joints[victim->skeleton.jointlabels[rightshoulder]].velocity+=relative*6; victim->skeleton.joints[victim->skeleton.jointlabels[leftshoulder]].velocity+=relative*6; } weapons[i].owner=id; if(num_weapons>0){ weaponids[num_weapons]=weaponids[0]; } num_weapons++; weaponids[0]=i; } } } } if(currentanimation==drawleftanim&&animation[targetanimation].label[currentframe]==5){ if(weaponactive==-1)weaponactive=0; else if(weaponactive==0){ weaponactive=-1; if(num_weapons==2){ int buffer; buffer=weaponids[0]; weaponids[0]=weaponids[1]; weaponids[1]=buffer; } } if(weaponactive==-1){ emit_sound_at(knifesheathesound, coords, 128.); } if(weaponactive!=-1){ emit_sound_at(knifedrawsound, coords, 128.); } } if((currentanimation==walljumprightkickanim&&targetanimation==walljumprightkickanim)||(currentanimation==walljumpleftkickanim&&targetanimation==walljumpleftkickanim)){ XYZ rotatetarget=DoRotation(skeleton.forward,0,rotation,0); Normalise(&rotatetarget); targetrotation=-asin(0-rotatetarget.x); targetrotation*=360/6.28; if(rotatetarget.z<0)targetrotation=180-targetrotation; if(targetanimation==walljumprightkickanim)targetrotation+=40; if(targetanimation==walljumpleftkickanim)targetrotation-=40; } bool dojumpattack; dojumpattack=0; if((targetanimation==rabbitrunninganim||targetanimation==wolfrunninganim)&&targetframe==3&&(jumpkeydown||attackkeydown||id!=0))dojumpattack=1; if(hasvictim) if(findDistancefast(&victim->coords,&/*player[i].*/coords)<5&&victim->aitype==gethelptype&&(attackkeydown)&&!victim->skeleton.free&&victim->isRun()&&victim->runninghowlong>=1)dojumpattack=1; if(!hostile)dojumpattack=0; if(dojumpattack){ if((targetanimation==rabbitrunninganim||targetanimation==wolfrunninganim)&&id==0){ targetanimation=rabbittackleanim; targetframe=0; emit_sound_at(jumpsound, coords); } float closestdist; closestdist=0; int closestid; closestid=-1; XYZ targetloc; targetloc=velocity; Normalise(&targetloc); targetloc+=coords; for(i=0;icoords; currentanimation=rabbittacklinganim; targetanimation=rabbittacklinganim; currentframe=0; targetframe=1; XYZ rotatetarget; if(coords.z!=victim->coords.z||coords.x!=victim->coords.x){ rotatetarget=coords-victim->coords; Normalise(&rotatetarget); targetrotation=-asin(0-rotatetarget.x); targetrotation*=360/6.28; if(rotatetarget.z<0)targetrotation=180-targetrotation; } if(targetanimation!=rabbitrunninganim){ emit_sound_at(jumpsound, coords, 128.); } } } //Move impacts float damagemult=1*power; if(creature==wolftype)damagemult=2.5*power; if(hasvictim){damagemult/=victim->damagetolerance/200;} //if(onfire)damagemult=3; if((animation[targetanimation].attack==normalattack||targetanimation==walljumprightkickanim||targetanimation==walljumpleftkickanim)&&(!feint)&&(victim->skeleton.free!=2||targetanimation==killanim||targetanimation==dropkickanim||targetanimation==crouchstabanim||targetanimation==swordgroundstabanim||targetanimation==staffgroundsmashanim)){ if(targetanimation==spinkickanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&3&&animation[victim->targetanimation].height!=lowheight){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2||creature==wolftype){ victim->spurt=1; DoBlood(.2,250); if(creature==wolftype)DoBloodBig(0,250); } if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*100/victim->protectionhead); SolidHitBonus(id); } } if(targetanimation==wolfslapanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&3&&animation[victim->targetanimation].height!=lowheight){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2||creature==wolftype){ victim->spurt=1; if(creature==wolftype)DoBloodBig(0,235); } emit_sound_at(whooshhitsound, victim->coords); if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2,175); } victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative.y-=1; Normalise(&relative); relative=DoRotation(relative,0,90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*20; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*100; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*50/victim->protectionhead); } } if(targetanimation==walljumprightkickanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&animation[victim->targetanimation].height!=lowheight){ escapednum=0; if(id==0)camerashake+=.4; victim->spurt=1; DoBlood(.2,250); if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 160.); } if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } victim->RagDoll(0); XYZ relative; relative=facing; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*150/victim->protectionhead); if(victim->damage>victim->damagetolerance) award_bonus(id, style); else SolidHitBonus(id); } } if(targetanimation==walljumpleftkickanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&animation[victim->targetanimation].height!=lowheight){ escapednum=0; if(id==0)camerashake+=.4; victim->spurt=1; DoBlood(.2,250); if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 160.); } if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } victim->RagDoll(0); XYZ relative; relative=facing; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*150/victim->protectionhead); if(victim->damage>victim->damagetolerance) award_bonus(id, style); else SolidHitBonus(id); } } if(targetanimation==blockhighleftstrikeanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&animation[victim->targetanimation].height!=lowheight){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,235); } emit_sound_at(whooshhitsound, victim->coords); victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*30; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*100; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*50/victim->protectionhead); } } if(targetanimation==killanim&&animation[targetanimation].label[currentframe]==8){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&victim->dead){ escapednum=0; if(id==0)camerashake+=.2; emit_sound_at(whooshhitsound, victim->coords, 128.); victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; victim->skeleton.spinny=1; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; victim->skeleton.joints[i].delay=0; victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } XYZ relative; relative=0; relative.y=1; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity.y=relative.y*10; victim->skeleton.joints[i].position.y+=relative.y*.3; victim->skeleton.joints[i].oldposition.y+=relative.y*.3; victim->skeleton.joints[i].realoldposition.y+=relative.y*.3; } victim->Puff(abdomen); victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity.y=relative.y*400; } } if(targetanimation==killanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*9&&victim->dead){ escapednum=0; if(id==0)camerashake+=.4; if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, coords, 128.); } XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*90; } victim->Puff(abdomen); if(victim->dead!=2&&victim->permanentdamage>victim->damagetolerance-250&&autoslomo){ slomo=1; slomodelay=.2; } victim->DoDamage(damagemult*500/victim->protectionhigh); victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*300; } } if(targetanimation==dropkickanim&&animation[targetanimation].label[currentframe]==7){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*9&&victim->skeleton.free){ escapednum=0; if(id==0)camerashake+=.4; if(tutoriallevel!=1){ emit_sound_at(thudsound, coords); } victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; victim->skeleton.spinny=1; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; //victim->skeleton.joints[i].delay=0; victim->skeleton.joints[i].locked=0; } XYZ relative; relative=victim->coords-coords; Normalise(&relative); relative.y+=.3; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*20; } if(!victim->dead) SolidHitBonus(id); victim->Puff(abdomen); victim->DoDamage(damagemult*20/victim->protectionhigh); victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; staggerdelay=.5; if(!victim->dead)staggerdelay=1.2; } } if((targetanimation==crouchstabanim||targetanimation==swordgroundstabanim)&&animation[targetanimation].label[currentframe]==5){ //if(id==0)camerashake+=.4; if(hasvictim) if(!victim->skeleton.free)hasvictim=0; if(!hasvictim){ terrain.MakeDecal(blooddecalfast,(weapons[weaponids[weaponactive]].tippoint*.8+weapons[weaponids[weaponactive]].position*.2),.08,.6,Random()%360); emit_sound_at(knifesheathesound, coords, 128.); } if(victim&&hasvictim){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3){ XYZ where,startpoint,endpoint,movepoint,colpoint; float rotationpoint; int whichtri; if(weapons[weaponids[weaponactive]].getType()==knife){ where=(weapons[weaponids[weaponactive]].tippoint*.6+weapons[weaponids[weaponactive]].position*.4); where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); //where=scale; startpoint=where; startpoint.y+=100; endpoint=where; endpoint.y-=100; } if(weapons[weaponids[weaponactive]].getType()==sword){ where=weapons[weaponids[weaponactive]].position; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); startpoint=where; where=weapons[weaponids[weaponactive]].tippoint; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); endpoint=where; } if(weapons[weaponids[weaponactive]].getType()==staff){ where=weapons[weaponids[weaponactive]].position; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); startpoint=where; where=weapons[weaponids[weaponactive]].tippoint; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); endpoint=where; } movepoint=0; rotationpoint=0; whichtri=victim->skeleton.drawmodel.LineCheck(&startpoint,&endpoint, &colpoint, &movepoint, &rotationpoint); if(whichtri!=-1){ if(victim->dead!=2){ victim->DoDamage(abs((victim->damagetolerance-victim->permanentdamage)*2)); if (!victim->dead) award_bonus(id, FinishedBonus); } if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } emit_sound_at(fleshstabsound, coords, 128); } if(whichtri!=-1||weapons[weaponids[weaponactive]].bloody){ weapons[weaponids[weaponactive]].blooddrip+=5; weapons[weaponids[weaponactive]].blooddripdelay=0; } if(whichtri==-1){ hasvictim=0; emit_sound_at(knifesheathesound, coords, 128.); } } } } if((targetanimation==crouchstabanim||targetanimation==swordgroundstabanim)&&animation[targetanimation].label[currentframe]==6){ if(!hasvictim){ emit_sound_at(knifedrawsound, coords, 128); } if(victim&&hasvictim){ XYZ footvel,footpoint; emit_sound_at(fleshstabremovesound, coords, 128.); footvel=0; footpoint=(weapons[weaponids[weaponactive]].tippoint*.8+weapons[weaponids[weaponactive]].position*.2); if(weapons[weaponids[weaponactive]].getType()==sword){ XYZ where,startpoint,endpoint,movepoint; float rotationpoint; int whichtri; where=weapons[weaponids[weaponactive]].position; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); startpoint=where; where=weapons[weaponids[weaponactive]].tippoint; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); endpoint=where; movepoint=0; rotationpoint=0; whichtri=victim->skeleton.drawmodel.LineCheck(&startpoint,&endpoint, &footpoint, &movepoint, &rotationpoint); footpoint+=victim->coords; if(whichtri==-1){ footpoint=(weapons[weaponids[weaponactive]].tippoint*.8+weapons[weaponids[weaponactive]].position*.2); } } if(weapons[weaponids[weaponactive]].getType()==staff){ XYZ where,startpoint,endpoint,movepoint; float rotationpoint; int whichtri; where=weapons[weaponids[weaponactive]].position; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); startpoint=where; where=weapons[weaponids[weaponactive]].tippoint; where-=victim->coords; if(!victim->skeleton.free)where=DoRotation(where,0,-victim->rotation,0); endpoint=where; movepoint=0; rotationpoint=0; whichtri=victim->skeleton.drawmodel.LineCheck(&startpoint,&endpoint, &footpoint, &movepoint, &rotationpoint); footpoint+=victim->coords; if(whichtri==-1){ footpoint=(weapons[weaponids[weaponactive]].tippoint*.8+weapons[weaponids[weaponactive]].position*.2); } } hasvictim=victim->DoBloodBigWhere(2,220,footpoint); if(hasvictim){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3){ victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } XYZ relative; relative=0; relative.y=10; Normalise(&relative); //victim->Puff(abdomen); if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); if(victim->bloodlossdamagetolerance){ victim->bloodloss+=1000; victim->bled=0; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*20; } } } if(!hasvictim&&onterrain){ weapons[weaponids[weaponactive]].bloody=0; weapons[weaponids[weaponactive]].blooddrip=0; } } if(targetanimation==upunchanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,235); } if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128); } victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=relative*30; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*150; victim->targetframe=0; victim->targetanimation=staggerbackhardanim; victim->targetrotation=targetrotation+180; victim->target=0; victim->stunned=1; victim->Puff(head); victim->Puff(abdomen); victim->DoDamage(damagemult*60/victim->protectionhigh); SolidHitBonus(id); } } if(targetanimation==winduppunchanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*2){ escapednum=0; if(id==0)camerashake+=.4; if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height!=lowheight){ if(tutoriallevel!=1){ emit_sound_at(thudsound, victim->coords); } } else if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height==lowheight){ if(tutoriallevel!=1){ emit_sound_at(whooshhitsound, victim->coords); } } else { if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords); } } if(victim->damage>victim->damagetolerance-60||normaldotproduct(victim->facing,victim->coords-coords)>0||animation[victim->targetanimation].height==lowheight) victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative.y=.3; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=relative*5; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*400; victim->targetframe=0; victim->targetanimation=staggerbackhardanim; victim->targetrotation=targetrotation+180; victim->target=0; victim->stunned=1; victim->Puff(abdomen); victim->DoDamage(damagemult*60/victim->protectionhigh); SolidHitBonus(id); } } if(targetanimation==blockhighleftanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*4){ if(victim->id==0)camerashake+=.4; emit_sound_at(landsound2, victim->coords); Puff(righthand); } } if(targetanimation==swordslashparryanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*4){ if(victim->id==0)camerashake+=.4; if(weaponactive!=-1){ if(weapons[victim->weaponids[0]].getType()==staff||weapons[weaponids[0]].getType()==staff){ if(weapons[victim->weaponids[0]].getType()==staff)weapons[victim->weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; if(weapons[weaponids[0]].getType()==staff)weapons[weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; emit_sound_at(swordstaffsound, victim->coords); } else{ emit_sound_at(metalhitsound, victim->coords); } } //Puff(righthand); } } if(targetanimation==knifethrowanim&&animation[targetanimation].label[currentframe]==5){ if(weaponactive!=-1){ escapednum=0; XYZ aim; weapons[weaponids[0]].owner=-1; aim=victim->coords+DoRotation(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position,0,victim->rotation,0)*victim->scale+victim->velocity*findDistance(&victim->coords,&coords)/50-(coords+DoRotation(skeleton.joints[skeleton.jointlabels[righthand]].position,0,rotation,0)*scale); Normalise(&aim); /*if(victim->targetanimation==jumpupanim||victim->targetanimation==jumpdownanim){ aim=DoRotation(aim,(float)abs(Random()%15)-7,(float)abs(Random()%15)-7,0); }*/ weapons[weaponids[0]].velocity=aim*50; weapons[weaponids[0]].tipvelocity=aim*50; weapons[weaponids[0]].missed=0; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=0; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; } weaponactive=-1; } } if(targetanimation==knifeslashstartanim&&animation[targetanimation].label[currentframe]==5){ if(hasvictim) if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*4.5&&/*animation[victim->targetanimation].height!=lowheight&&*/victim->targetanimation!=dodgebackanim&&victim->targetanimation!=rollanim){ escapednum=0; if(tutoriallevel!=1)victim->DoBloodBig(1.5/victim->armorhigh,225); award_bonus(id, Slicebonus); if(tutoriallevel!=1){ emit_sound_at(knifeslicesound, victim->coords); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; if(animation[victim->targetanimation].attack&&(victim->aitype!=playercontrolled||victim->targetanimation==knifeslashstartanim)&&(victim->creature==rabbittype||victim->deathbleeding<=0)){ if(victim->id != 0 || difficulty==2){ victim->targetframe=0; victim->targetanimation=staggerbackhardanim; victim->targetrotation=targetrotation+180; victim->target=0; } } victim->lowreversaldelay=0; victim->highreversaldelay=0; if(aitype!=playercontrolled)weaponmissdelay=.6; if(tutoriallevel!=1)if(bloodtoggle&&!weapons[weaponids[weaponactive]].bloody)weapons[weaponids[weaponactive]].bloody=1; if(tutoriallevel!=1)weapons[weaponids[weaponactive]].blooddrip+=3; XYZ footvel,footpoint; footvel=0; if(skeleton.free){ footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords; } if(!skeleton.free){ footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords; } if(tutoriallevel!=1){ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3); footvel=DoRotation(facing,0,90,0)*.8; //footvel.y-=.3; Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1); } if(tutoriallevel==1){ Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .6, .3); } victim->DoDamage(damagemult*0); } } if(targetanimation==swordslashanim&&animation[targetanimation].label[currentframe]==5&&victim->targetanimation!=rollanim){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*6.5&&victim->targetanimation!=dodgebackanim){ if(victim->weaponactive==-1||normaldotproduct(victim->facing,victim->coords-coords)>0||(Random()%2==0)){ award_bonus(id, Slashbonus); escapednum=0; if(tutoriallevel!=1){ if(normaldotproduct(victim->facing,victim->coords-coords)<0)victim->DoBloodBig(2/victim->armorhigh,190); else victim->DoBloodBig(2/victim->armorhigh,185); victim->deathbleeding=1; emit_sound_at(swordslicesound, victim->coords); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; if(tutoriallevel!=1){ victim->targetframe=0; victim->targetanimation=staggerbackhardanim; victim->targetrotation=targetrotation+180; victim->target=0; } if(tutoriallevel!=1){ if(bloodtoggle&&!weapons[weaponids[weaponactive]].bloody)weapons[weaponids[weaponactive]].bloody=1; weapons[weaponids[weaponactive]].blooddrip+=3; float bloodlossamount; bloodlossamount=200+abs((float)(Random()%40))-20; victim->bloodloss+=bloodlossamount/victim->armorhigh; //victim->bloodloss+=100*(6.5-findDistancefast(&coords,&victim->coords)); victim->DoDamage(damagemult*0); XYZ footvel,footpoint; footvel=0; if(skeleton.free){ footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords; } if(!skeleton.free){ footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords; } if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=DoRotation(facing,0,90,0)*.8; footvel.y-=.3; Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1); } } else { if(victim->weaponactive!=-1){ if(weapons[victim->weaponids[0]].getType()==staff||weapons[weaponids[0]].getType()==staff){ if(weapons[victim->weaponids[0]].getType()==staff)weapons[victim->weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; if(weapons[weaponids[0]].getType()==staff)weapons[weaponids[0]].damage+=.2+float(abs(Random()%100)-50)/250; emit_sound_at(swordstaffsound, victim->coords); } else{ emit_sound_at(metalhitsound, victim->coords); } } XYZ aim; victim->Puff(righthand); victim->target=0; victim->targetframe=0; victim->targetanimation=staggerbackhighanim; victim->targetrotation=targetrotation+180; victim->target=0; weapons[victim->weaponids[0]].owner=-1; aim=DoRotation(facing,0,90,0)*21; aim.y+=7; weapons[victim->weaponids[0]].velocity=aim*-.2; weapons[victim->weaponids[0]].tipvelocity=aim; weapons[victim->weaponids[0]].missed=1; weapons[weaponids[0]].hitsomething=0; weapons[victim->weaponids[0]].freetime=0; weapons[victim->weaponids[0]].firstfree=1; weapons[victim->weaponids[0]].physics=1; victim->num_weapons--; if(victim->num_weapons){ victim->weaponids[0]=victim->weaponids[num_weapons]; if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; for(i=0;itargetanimation!=rollanim){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*6.5&&victim->targetanimation!=dodgebackanim&&victim->targetanimation!=sweepanim){ if(tutoriallevel!=1){ weapons[weaponids[0]].damage+=.4+float(abs(Random()%100)-50)/250; escapednum=0; if(id==0)camerashake+=.4; if(Random()%2||creature==wolftype){ victim->spurt=1; } emit_sound_at(staffheadsound, victim->coords); } victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,90,0); relative.y-=1; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*60; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*230; victim->skeleton.joints[victim->skeleton.jointlabels[neck]].velocity+=relative*damagemult*230; //FootLand(1,2); victim->Puff(head); if(tutoriallevel!=1){ victim->DoDamage(damagemult*120/victim->protectionhigh); award_bonus(id, solidhit, 30); } } } if(targetanimation==staffspinhitanim&&animation[targetanimation].label[currentframe]==5&&victim->targetanimation!=rollanim){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*6.5&&victim->targetanimation!=dodgebackanim&&victim->targetanimation!=sweepanim){ if(tutoriallevel!=1){ weapons[weaponids[0]].damage+=.6+float(abs(Random()%100)-50)/250; escapednum=0; if(id==0)camerashake+=.4; if(Random()%2||creature==wolftype){ victim->spurt=1; } emit_sound_at(staffheadsound, victim->coords); } victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*220; victim->skeleton.joints[victim->skeleton.jointlabels[neck]].velocity+=relative*damagemult*220; //FootLand(1,2); victim->Puff(head); if(tutoriallevel!=1){victim->DoDamage(damagemult*350/victim->protectionhead); award_bonus(id, solidhit, 60); } } } if(targetanimation==staffgroundsmashanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*6.5){ escapednum=0; if(tutoriallevel!=1){ if(!victim->dead)weapons[weaponids[0]].damage+=.4+float(abs(Random()%100)-50)/500; if(id==0)camerashake+=.4; if(Random()%2||creature==wolftype){ victim->spurt=1; } emit_sound_at(staffbodysound, victim->coords); } victim->skeleton.longdead=0; victim->skeleton.free=1; victim->skeleton.broken=0; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } victim->RagDoll(0); XYZ relative; relative=0; /*relative=victim->coords-coords; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,90,0);*/ relative.y=-1; Normalise(&relative); if(!victim->dead){ for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=relative*damagemult*40; } //FootLand(1,2); victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*40; } if(victim->dead){ for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=relative*damagemult*abs(Random()%20); } //FootLand(1,2); //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*20; } victim->Puff(abdomen); if(tutoriallevel!=1){victim->DoDamage(damagemult*100/victim->protectionhigh); if(!victim->dead){ award_bonus(id, solidhit, 40); } } } } if(targetanimation==lowkickanim&&animation[targetanimation].label[currentframe]==5){ if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&animation[victim->targetanimation].height!=highheight){ escapednum=0; if(id==0)camerashake+=.4; XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); SolidHitBonus(id); if(animation[victim->targetanimation].height==lowheight){ if(Random()%2){ victim->spurt=1; DoBlood(.2,250); } victim->RagDoll(0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } victim->Puff(head); victim->DoDamage(damagemult*100/victim->protectionhead); if(victim->howactive==typesleeping)victim->DoDamage(damagemult*150/victim->protectionhead); if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } } else{ if(victim->damage>=victim->damagetolerance)victim->RagDoll(0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*10; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; victim->targetframe=0; victim->targetanimation=staggerbackhighanim; victim->targetrotation=targetrotation+180; victim->target=0; if(tutoriallevel!=1){ emit_sound_at(landsound2, victim->coords, 128.); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionhigh); if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } } } } if(targetanimation==sweepanim&&animation[targetanimation].label[currentframe]==5){ if(victim->targetanimation!=jumpupanim&&findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*3&&victim!=this){ escapednum=0; if(id==0)camerashake+=.2; if(tutoriallevel!=1){ emit_sound_at(landsound2, victim->coords, 128.); } XYZ relative; relative=victim->coords-coords; relative.y=0; Normalise(&relative); if(animation[victim->targetanimation].height==middleheight||animation[victim->currentanimation].height==middleheight||victim->damage>=victim->damagetolerance-40){ victim->RagDoll(0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*15; } relative=DoRotation(relative,0,-90,0); relative.y+=.1; for(i=0;iskeleton.num_joints;i++){ if(victim->skeleton.joints[i].label==leftfoot||victim->skeleton.joints[i].label==rightfoot||victim->skeleton.joints[i].label==leftankle||victim->skeleton.joints[i].label==rightankle) victim->skeleton.joints[i].velocity=relative*80; } victim->Puff(rightankle); victim->Puff(leftankle); victim->DoDamage(damagemult*40/victim->protectionlow); } else{ if(victim->damage>=victim->damagetolerance)victim->RagDoll(0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*10; } relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ if(victim->skeleton.joints[i].label==leftfoot||victim->skeleton.joints[i].label==rightfoot||victim->skeleton.joints[i].label==leftankle||victim->skeleton.joints[i].label==rightankle) victim->skeleton.joints[i].velocity+=relative*damagemult*80; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; victim->targetframe=0; victim->targetanimation=staggerbackhighanim; victim->targetrotation=targetrotation+180; victim->target=0; if(tutoriallevel!=1){ emit_sound_at(landsound2, victim->coords, 128.); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionlow); } SolidHitBonus(id); } } } if(animation[targetanimation].attack==reversal&&(!victim->feint||(victim->lastattack==victim->lastattack2&&victim->lastattack2==victim->lastattack3&&Random()%2)||targetanimation==knifefollowanim)){ if(targetanimation==spinkickreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,230); } if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } if(creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } victim->RagDoll(0); XYZ relative; relative=victim->coords-oldcoords; relative.y=0; Normalise(&relative); //relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(abdomen); victim->DoDamage(damagemult*150/victim->protectionhigh); award_bonus(id, Reversal); } if((targetanimation==swordslashreversalanim||targetanimation==knifeslashreversalanim||targetanimation==staffhitreversalanim||targetanimation==staffspinhitreversalanim)&&animation[targetanimation].label[currentframe]==5){ if(victim->weaponactive!=-1&&victim->num_weapons>0){ if(weapons[victim->weaponids[victim->weaponactive]].owner==victim->id){ weapons[victim->weaponids[victim->weaponactive]].owner=id; weaponactive=0; if(num_weapons>0){ weaponids[num_weapons]=weaponids[victim->weaponactive]; } num_weapons++; weaponids[0]=victim->weaponids[victim->weaponactive]; victim->num_weapons--; if(victim->num_weapons>0){ victim->weaponids[victim->weaponactive]=victim->weaponids[victim->num_weapons]; //if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0; } victim->weaponactive=-1; } } } if(targetanimation==staffhitreversalanim&&animation[targetanimation].label[currentframe]==5){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,230); } emit_sound_at(whooshhitsound, victim->coords, 128.); victim->RagDoll(0); XYZ relative; relative=victim->coords-oldcoords; relative.y=0; Normalise(&relative); //relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*30; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*70/victim->protectionhigh); } if(targetanimation==staffspinhitreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,230); } award_bonus(id, staffreversebonus); if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } victim->RagDoll(0); award_bonus(id, staffreversebonus); // Huh, again? XYZ relative; relative=victim->coords-oldcoords; relative.y=0; Normalise(&relative); //relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*30; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(head); victim->DoDamage(damagemult*70/victim->protectionhigh); } if(targetanimation==upunchreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; victim->RagDoll(1); XYZ relative; relative=facing; relative.y=0; Normalise(&relative); //relative*=-1; relative.y-=.1; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*70; } victim->skeleton.joints[victim->skeleton.jointlabels[lefthand]].velocity*=.1; victim->skeleton.joints[victim->skeleton.jointlabels[leftwrist]].velocity*=.2; victim->skeleton.joints[victim->skeleton.jointlabels[leftelbow]].velocity*=.5; victim->skeleton.joints[victim->skeleton.jointlabels[leftshoulder]].velocity*=.7; victim->skeleton.joints[victim->skeleton.jointlabels[righthand]].velocity*=.1; victim->skeleton.joints[victim->skeleton.jointlabels[rightwrist]].velocity*=.2; victim->skeleton.joints[victim->skeleton.jointlabels[rightelbow]].velocity*=.5; victim->skeleton.joints[victim->skeleton.jointlabels[rightshoulder]].velocity*=.7; victim->Puff(abdomen); victim->DoDamage(damagemult*90/victim->protectionhigh); award_bonus(id, Reversal); bool doslice; doslice=0; if(weaponactive!=-1||creature==wolftype)doslice=1; if(creature==rabbittype&&weaponactive!=-1)if(weapons[weaponids[0]].getType()==staff)doslice=0; if(doslice){ if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhigh,225); emit_sound_at(knifeslicesound, victim->coords); if(bloodtoggle&&!weapons[weaponids[weaponactive]].bloody)weapons[weaponids[weaponactive]].bloody=1; weapons[weaponids[weaponactive]].blooddrip+=3; } if(weaponactive==-1&&creature==wolftype){; emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,175); } } } if(targetanimation==swordslashreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; victim->RagDoll(1); XYZ relative; relative=facing; relative.y=0; Normalise(&relative); //relative*=-1; relative.y-=.1; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*70; } victim->skeleton.joints[victim->skeleton.jointlabels[lefthand]].velocity*=.1-1; victim->skeleton.joints[victim->skeleton.jointlabels[leftwrist]].velocity*=.2-1; victim->skeleton.joints[victim->skeleton.jointlabels[leftelbow]].velocity*=.5-1; victim->skeleton.joints[victim->skeleton.jointlabels[leftshoulder]].velocity*=.7-1; victim->skeleton.joints[victim->skeleton.jointlabels[righthand]].velocity*=.1-1; victim->skeleton.joints[victim->skeleton.jointlabels[rightwrist]].velocity*=.2-1; victim->skeleton.joints[victim->skeleton.jointlabels[rightelbow]].velocity*=.5-1; victim->skeleton.joints[victim->skeleton.jointlabels[rightshoulder]].velocity*=.7-1; award_bonus(id, swordreversebonus); } if(hasvictim&&targetanimation==knifeslashreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,230); } if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } victim->RagDoll(0); XYZ relative; relative=victim->coords-oldcoords; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,-90,0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //FootLand(1,2); victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionhigh); award_bonus(id, Reversal); } if(hasvictim&&targetanimation==sneakattackanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; victim->RagDoll(0); victim->skeleton.spinny=0; XYZ relative; relative=facing*-1; relative.y=-3; Normalise(&relative); if(victim->id==0)relative/=30; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*40; } //victim->DoDamage(1000); victim->damage=victim->damagetolerance; victim->permanentdamage=victim->damagetolerance-1; bool doslice; doslice=0; if(weaponactive!=-1||creature==wolftype)doslice=1; if(creature==rabbittype&&weaponactive!=-1)if(weapons[weaponids[0]].getType()==staff)doslice=0; if(doslice){ if(weaponactive!=-1){ victim->DoBloodBig(200,225); emit_sound_at(knifeslicesound, victim->coords); if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; weapons[weaponids[weaponactive]].blooddrip+=5; } if(creature==wolftype&&weaponactive==-1){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2,175); } } award_bonus(id, spinecrusher); } if(hasvictim&&(targetanimation==knifefollowanim||targetanimation==knifesneakattackanim)&&animation[targetanimation].label[currentframe]==5){ if(weaponactive!=-1&&victim->bloodlossdamagetolerance){ escapednum=0; if(targetanimation==knifefollowanim)victim->DoBloodBig(200,210); if(targetanimation==knifesneakattackanim){ /*victim->DoBloodBig(200,195); XYZ bloodvel; bloodvel=0; bloodvel.z=20; bloodvel.y=5; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); */ XYZ footvel,footpoint; footvel=0; footpoint=weapons[weaponids[0]].tippoint; if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=(weapons[weaponids[0]].tippoint-weapons[weaponids[0]].position); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1); victim->DoBloodBig(200,195); award_bonus(id, tracheotomy); } if(targetanimation==knifefollowanim){ award_bonus(id, Stabbonus); XYZ footvel,footpoint; footvel=0; footpoint=weapons[weaponids[0]].tippoint; if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=(weapons[weaponids[0]].tippoint-weapons[weaponids[0]].position)*-1; Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1); } victim->bloodloss+=10000; victim->velocity=0; emit_sound_at(fleshstabsound, victim->coords); if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; weapons[weaponids[weaponactive]].blooddrip+=5; } } if(hasvictim&&(targetanimation==knifefollowanim||targetanimation==knifesneakattackanim)&&animation[targetanimation].label[currentframe]==6){ escapednum=0; victim->velocity=0; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=0; } if(targetanimation==knifefollowanim){ victim->RagDoll(0); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=0; } } if(weaponactive!=-1&&animation[victim->targetanimation].attack!=reversal){ emit_sound_at(fleshstabremovesound, victim->coords); if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; weapons[weaponids[weaponactive]].blooddrip+=5; XYZ footvel,footpoint; footvel=0; footpoint=weapons[weaponids[0]].tippoint; if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=(weapons[weaponids[0]].tippoint-weapons[weaponids[0]].position)*-1; Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1); } } if(hasvictim&&(targetanimation==swordsneakattackanim)&&animation[targetanimation].label[currentframe]==5){ if(weaponactive!=-1&&victim->bloodlossdamagetolerance){ award_bonus(id, backstab); escapednum=0; XYZ footvel,footpoint; footvel=0; footpoint=(weapons[weaponids[0]].tippoint+weapons[weaponids[0]].position)/2; if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=(weapons[weaponids[0]].tippoint-weapons[weaponids[0]].position); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*5,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1); victim->DoBloodBig(200,180); victim->DoBloodBig(200,215); victim->bloodloss+=10000; victim->velocity=0; emit_sound_at(fleshstabsound, victim->coords); if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; weapons[weaponids[weaponactive]].blooddrip+=5; } } if(hasvictim&&targetanimation==swordsneakattackanim&&animation[targetanimation].label[currentframe]==6){ escapednum=0; victim->velocity=0; for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity=0; } if(weaponactive!=-1){ emit_sound_at(fleshstabremovesound, victim->coords); if(bloodtoggle)weapons[weaponids[weaponactive]].bloody=2; weapons[weaponids[weaponactive]].blooddrip+=5; XYZ footvel,footpoint; footvel=0; footpoint=weapons[weaponids[0]].tippoint; if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=(weapons[weaponids[0]].tippoint-weapons[weaponids[0]].position)*-1; Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1); Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1); } } if(targetanimation==sweepreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; if(id==0)camerashake+=.4; if(Random()%2){ victim->spurt=1; DoBlood(.2,240); } if(weaponactive==-1){ if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, victim->coords, 128.); } } bool doslice; doslice=0; if(weaponactive!=-1||creature==wolftype)doslice=1; if(creature==rabbittype&&weaponactive!=-1)if(weapons[weaponids[0]].getType()==staff)doslice=0; if(doslice){ if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhead,225); emit_sound_at(knifeslicesound, victim->coords); if(bloodtoggle&&!weapons[weaponids[weaponactive]].bloody)weapons[weaponids[weaponactive]].bloody=1; weapons[weaponids[weaponactive]].blooddrip+=3; } if(weaponactive==-1&&creature==wolftype){ emit_sound_at(clawslicesound, victim->coords, 128.); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } } award_bonus(id, Reversal); victim->Puff(neck); XYZ relative; //relative=victim->coords-oldcoords; relative=facing*-1; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,90,0); relative.y=.5; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*20; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; if(victim->damagedamagetolerance-100)victim->velocity=relative*200; victim->DoDamage(damagemult*100/victim->protectionhead); victim->velocity=0; } if(targetanimation==sweepreversalanim&&((animation[targetanimation].label[currentframe]==9&&victim->damagedamagetolerance)||(animation[targetanimation].label[currentframe]==7&&victim->damage>victim->damagetolerance))){ escapednum=0; victim->RagDoll(0); XYZ relative; //relative=victim->coords-oldcoords; relative=facing*-1; relative.y=0; Normalise(&relative); relative=DoRotation(relative,0,90,0); relative.y=.5; Normalise(&relative); for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velocity+=relative*damagemult*20; } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; } if(hasvictim&&(targetanimation==spinkickreversalanim||targetanimation==sweepreversalanim||targetanimation==rabbitkickreversalanim||targetanimation==upunchreversalanim||targetanimation==jumpreversalanim||targetanimation==swordslashreversalanim||targetanimation==knifeslashreversalanim||targetanimation==rabbittacklereversal||targetanimation==wolftacklereversal||targetanimation==staffhitreversalanim||targetanimation==staffspinhitreversalanim)) if(victim->damage>victim->damagetolerance&&bonus!=reverseko){ award_bonus(id, reverseko); } } //Animation end if(targetframe>animation[currentanimation].numframes-1){ targetframe=0; if(wasStop()){ targetanimation=getIdle(); FootLand(0,1); FootLand(1,1); } if(currentanimation==rabbittackleanim||currentanimation==rabbittacklinganim){ targetanimation=rollanim; targetframe=3; emit_sound_at(movewhooshsound, coords, 128.); } if(currentanimation==staggerbackhighanim){ targetanimation=getIdle(); } if(currentanimation==staggerbackhardanim){ targetanimation=getIdle(); } if(currentanimation==removeknifeanim){ targetanimation=getIdle(); } if(currentanimation==crouchremoveknifeanim){ targetanimation=getCrouch(); } if(currentanimation==backhandspringanim){ targetanimation=getIdle(); } if(currentanimation==dodgebackanim){ targetanimation=getIdle(); } if(currentanimation==drawleftanim){ targetanimation=getIdle(); } if(currentanimation==drawrightanim||currentanimation==crouchdrawrightanim){ targetanimation=getIdle(); if(currentanimation==crouchdrawrightanim){ targetanimation=getCrouch(); } if(weaponactive==-1)weaponactive=0; else if(weaponactive==0){ weaponactive=-1; if(num_weapons==2){ int buffer; buffer=weaponids[0]; weaponids[0]=weaponids[1]; weaponids[1]=buffer; } } if(weaponactive==-1){ emit_sound_at(knifesheathesound, coords, 128.); } if(weaponactive!=-1){ emit_sound_at(knifedrawsound, coords, 128.); } } if(currentanimation==rollanim){ targetanimation=getCrouch(); FootLand(0,1); FootLand(1,1); } if(isFlip()){ if(targetanimation==walljumprightkickanim){ targetrot=-190; } if(targetanimation==walljumpleftkickanim){ targetrot=190; } targetanimation=jumpdownanim; } if(currentanimation==climbanim){ targetanimation=getCrouch(); targetframe=1; coords+=facing*.1; if(!isnormal(coords.x)) coords=oldcoords; oldcoords=coords; collided=0; targetoffset=0; currentoffset=0; grabdelay=1; velocity=0; collided=0; avoidcollided=0; } if(targetanimation==rabbitkickreversalanim){ targetanimation=getCrouch(); lastfeint=0; } if(targetanimation==jumpreversalanim){ targetanimation=getCrouch(); lastfeint=0; } if(targetanimation==walljumprightanim||targetanimation==walljumpbackanim||targetanimation==walljumpfrontanim){ if(attackkeydown&&targetanimation!=walljumpfrontanim){ int closest=-1; float closestdist=-1; float distance; if(numplayers>1) for(i=0;i0&&closest>=0&&closestdist<16){ victim=&player[closest]; targetanimation=walljumprightkickanim; targetframe=0; XYZ rotatetarget=victim->coords-coords; Normalise(&rotatetarget); rotation=-asin(0-rotatetarget.x); rotation*=360/6.28; if(rotatetarget.z<0)rotation=180-rotation; targettilt2=-asin(rotatetarget.y)*360/6.28; velocity=(victim->coords-coords)*4; velocity.y+=2; transspeed=40; } } if(targetanimation==walljumpbackanim){ targetanimation=backflipanim; targetframe=3; velocity=facing*-8; velocity.y=4; if(id==0) resume_stream(whooshsound); } if(targetanimation==walljumprightanim){ targetanimation=rightflipanim; targetframe=4; targetrotation-=90; rotation-=90; velocity=DoRotation(facing,0,30,0)*-8; velocity.y=4; } if(targetanimation==walljumpfrontanim){ targetanimation=frontflipanim; targetframe=2; //targetrotation-=180; ////rotation-=180; velocity=facing*8; velocity.y=4; } if(id==0) resume_stream(whooshsound); } if(targetanimation==walljumpleftanim){ if(attackkeydown){ int closest=-1; float closestdist=-1; float distance; if(numplayers>1) for(i=0;i0&&closest>=0&&closestdist<16){ victim=&player[closest]; targetanimation=walljumpleftkickanim; targetframe=0; XYZ rotatetarget=victim->coords-coords; Normalise(&rotatetarget); rotation=-asin(0-rotatetarget.x); rotation*=360/6.28; if(rotatetarget.z<0)rotation=180-rotation; targettilt2=-asin(rotatetarget.y)*360/6.28; velocity=(victim->coords-coords)*4; velocity.y+=2; transspeed=40; } } if(targetanimation!=walljumpleftkickanim){ targetanimation=leftflipanim; targetframe=4; targetrotation+=90; rotation+=90; velocity=DoRotation(facing,0,-30,0)*-8; velocity.y=4; } if(id==0) resume_stream(whooshsound); } if(targetanimation==sneakattackanim){ currentanimation=getCrouch(); targetanimation=getCrouch(); targetframe=1; currentframe=0; targetrotation+=180; rotation+=180; targettilt2*=-1; tilt2*=-1; transspeed=1000000; targetheadrotation+=180; coords-=facing*.7; if(onterrain)coords.y=terrain.getHeight(coords.x,coords.z); lastfeint=0; } if(targetanimation==knifesneakattackanim||targetanimation==swordsneakattackanim){ targetanimation=getIdle(); targetframe=0; if(onterrain)coords.y=terrain.getHeight(coords.x,coords.z); lastfeint=0; } if(currentanimation==knifefollowanim){ targetanimation=getIdle(); lastfeint=0; } if(animation[targetanimation].attack==reversal&¤tanimation!=sneakattackanim&¤tanimation!=knifesneakattackanim&¤tanimation!=swordsneakattackanim&¤tanimation!=knifefollowanim){ float ycoords=oldcoords.y; targetanimation=getStop(); targetrotation+=180; rotation+=180; targettilt2*=-1; tilt2*=-1; transspeed=1000000; targetheadrotation+=180; if(!isnormal(coords.x)) coords=oldcoords; if(currentanimation==spinkickreversalanim||currentanimation==swordslashreversalanim) oldcoords=coords+facing*.5; else if(currentanimation==sweepreversalanim) oldcoords=coords+facing*1.1; else if(currentanimation==upunchreversalanim){ oldcoords=coords+facing*1.5; targetrotation+=180; rotation+=180; targetheadrotation+=180; targettilt2*=-1; tilt2*=-1; } else if(currentanimation==knifeslashreversalanim){ oldcoords=coords+facing*.5; targetrotation+=90; rotation+=90; targetheadrotation+=90; targettilt2=0; tilt2=0; } else if(currentanimation==staffspinhitreversalanim){ targetrotation+=180; rotation+=180; targetheadrotation+=180; targettilt2=0; tilt2=0; } if(onterrain)oldcoords.y=terrain.getHeight(oldcoords.x,oldcoords.z); else oldcoords.y=ycoords; currentoffset=coords-oldcoords; targetoffset=0; coords=oldcoords; lastfeint=0; } if(currentanimation==knifesneakattackedanim||currentanimation==swordsneakattackedanim){ velocity=0; velocity.y=-5; RagDoll(0); } if(animation[targetanimation].attack==reversed){ escapednum++; if(targetanimation==sweepreversedanim)targetrotation+=90; targetanimation=backhandspringanim; targetframe=2; emit_sound_at(landsound, coords, 128); if(currentanimation==upunchreversedanim||currentanimation==swordslashreversedanim){ targetanimation=rollanim; targetframe=5; oldcoords=coords; coords+=(DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)+DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0))/2*scale; coords.y=oldcoords.y; } if(currentanimation==knifeslashreversedanim){ targetanimation=rollanim; targetframe=0; targetrotation+=90; rotation+=90; oldcoords=coords; coords+=(DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)+DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0))/2*scale; coords.y=oldcoords.y; } } if(wasFlip()){ targetanimation=jumpdownanim; } if(wasLanding())targetanimation=getIdle(); if(wasLandhard())targetanimation=getIdle(); if(currentanimation==spinkickanim||currentanimation==getupfrombackanim||currentanimation==getupfromfrontanim||currentanimation==lowkickanim){ targetanimation=getIdle(); oldcoords=coords; coords+=(DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)+DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0))/2*scale; coords.y=oldcoords.y; //coords+=DoRotation(animation[currentanimation].offset,0,rotation,0)*scale; targetoffset.y=coords.y; if(onterrain)targetoffset.y=terrain.getHeight(coords.x,coords.z); currentoffset=DoRotation(animation[currentanimation].offset*-1,0,rotation,0)*scale; currentoffset.y-=(coords.y-targetoffset.y); coords.y=targetoffset.y; targetoffset=0; normalsupdatedelay=0; } if(currentanimation==upunchanim){ targetanimation=getStop(); normalsupdatedelay=0; lastfeint=0; } if(currentanimation==rabbitkickanim&&targetanimation!=backflipanim){ targetrotation=rotation; bool hasstaff; hasstaff=0; if(num_weapons>0)if(weapons[0].getType()==staff)hasstaff=1; if(!hasstaff)DoDamage(35); RagDoll(0); lastfeint=0; rabbitkickragdoll=1; } if(currentanimation==rabbitkickreversedanim){ if(!feint){ velocity=0; velocity.y=-10; //DoDamage(100); RagDoll(0); skeleton.spinny=0; SolidHitBonus(!id); // FIXME: tricky id } if(feint){ escapednum++; targetanimation=rollanim; coords+=facing; if(id==0)pause_sound(whooshsound); } lastfeint=0; } if(currentanimation==rabbittackledbackanim||currentanimation==rabbittackledfrontanim){ velocity=0; velocity.y=-10; RagDoll(0); skeleton.spinny=0; } if(currentanimation==jumpreversedanim){ if(!feint){ velocity=0; velocity.y=-10; //DoDamage(100); RagDoll(0); skeleton.spinny=0; SolidHitBonus(!id); // FIXME: tricky id } if(feint){ escapednum++; targetanimation=rollanim; coords+=facing*2; if(id==0)pause_sound(whooshsound); } lastfeint=0; } if(animation[currentanimation].attack==normalattack&&!victim->skeleton.free&&victim->targetanimation!=staggerbackhighanim&&victim->targetanimation!=staggerbackhardanim&&targetanimation!=winduppunchblockedanim&&targetanimation!=blockhighleftanim&&targetanimation!=swordslashparryanim&&targetanimation!=swordslashparriedanim&&targetanimation!=crouchstabanim&&targetanimation!=swordgroundstabanim){ targetanimation=getupfromfrontanim; lastfeint=0; } else if(animation[currentanimation].attack==normalattack){ targetanimation=getIdle(); lastfeint=0; } if(currentanimation==blockhighleftanim&&aitype!=playercontrolled){ targetanimation=blockhighleftstrikeanim; } if(currentanimation==knifeslashstartanim||currentanimation==knifethrowanim||currentanimation==swordslashanim||currentanimation==staffhitanim||currentanimation==staffgroundsmashanim||currentanimation==staffspinhitanim){ targetanimation=getIdle(); lastfeint=0; } if(currentanimation==spinkickanim&&victim->skeleton.free){ if(creature==rabbittype)targetanimation=fightidleanim; } } target=0; if(isIdle()&&!wasIdle())normalsupdatedelay=0; if(currentanimation==jumpupanim&&velocity.y<0&&!isFlip()){ targetanimation=jumpdownanim; } } if(!skeleton.free){ oldtarget=target; if(!transspeed&&animation[targetanimation].attack!=2&&animation[targetanimation].attack!=3){ if(!isRun()||!wasRun()){ if(animation[targetanimation].speed[targetframe]>animation[currentanimation].speed[currentframe]) target+=multiplier*animation[targetanimation].speed[targetframe]*speed*2; if(animation[targetanimation].speed[targetframe]<=animation[currentanimation].speed[currentframe]) target+=multiplier*animation[currentanimation].speed[currentframe]*speed*2; } if(isRun()&&wasRun()){ float tempspeed; tempspeed=velspeed; if(tempspeed<10*speedmult)tempspeed=10*speedmult; target+=multiplier*animation[targetanimation].speed[currentframe]*speed*1.7*tempspeed/(speed*45*scale); } } else if(transspeed)target+=multiplier*transspeed*speed*2; else{ if(!isRun()||!wasRun()){ if(animation[targetanimation].speed[targetframe]>animation[currentanimation].speed[currentframe]) target+=multiplier*animation[targetanimation].speed[targetframe]*2; if(animation[targetanimation].speed[targetframe]<=animation[currentanimation].speed[currentframe]) target+=multiplier*animation[currentanimation].speed[currentframe]*2; } } if(currentanimation!=targetanimation)target=(target+oldtarget)/2; if(target>1){currentframe=targetframe; target=1;} oldrot=rot; rot=targetrot*target; rotation+=rot-oldrot; if(target==1){ rot=0; oldrot=0; targetrot=0; } if(currentanimation!=oldcurrentanimation||targetanimation!=oldtargetanimation||((currentframe!=oldcurrentframe||targetframe!=oldtargetframe)&&!calcrot)){ //Old rotates for(i=0;iskeleton.muscles[i].oldrotate3+180)skeleton.muscles[i].newrotate3-=360; if(skeleton.muscles[i].newrotate3skeleton.muscles[i].oldrotate2+180)skeleton.muscles[i].newrotate2-=360; if(skeleton.muscles[i].newrotate2skeleton.muscles[i].oldrotate1+180)skeleton.muscles[i].newrotate1-=360; if(skeleton.muscles[i].newrotate1=animation[currentanimation].numframes)currentframe=animation[currentanimation].numframes-1; oldcurrentanimation=currentanimation; oldtargetanimation=targetanimation; oldtargetframe=targetframe; oldcurrentframe=currentframe; for(i=0;i0||bloodloss>0)immobile=0; if(isIdle()||isRun())targetoffset=0; if(num_weapons==1&&weaponactive!=-1)weaponstuck=-1; if(id==0)blooddimamount-=multiplier*.3; speechdelay-=multiplier; texupdatedelay-=multiplier; interestdelay-=multiplier; flamedelay-=multiplier; parriedrecently-=multiplier; if(!victim){ victim=this; hasvictim=0; } if(id==0)speed=1.1*speedmult; else speed=1.0*speedmult; if(!skeleton.free)rabbitkickragdoll=0; speed*=speedmult; if(id!=0&&(creature==rabbittype||difficulty!=2))superruntoggle=0; if(id!=0&&creature==wolftype&&difficulty==2){ superruntoggle=0; if(aitype!=passivetype){ superruntoggle=1; if(aitype==attacktypecutoff&&(player[0].isIdle()||player[0].isCrouch()||player[0].skeleton.free||player[0].targetanimation==getupfrombackanim||player[0].targetanimation==getupfromfrontanim||player[0].targetanimation==sneakanim)&&findDistancefast(&coords,&player[0].coords)<16){ superruntoggle=0; } } if(scale<0.2)superruntoggle=0; if(targetanimation==wolfrunninganim&&!superruntoggle){ targetanimation=getRun(); targetframe=0; } } if(weaponactive==-1&&num_weapons>0){ if(weapons[weaponids[0]].getType()==staff){ weaponactive=0; } } if(onfire){ burnt+=multiplier; /*if(aitype!=playercontrolled)*///deathbleeding=5; /*if(aitype!=playercontrolled)*/ deathbleeding=1; if(burnt>.6)burnt=.6; OPENAL_SetVolume(channels[stream_firesound], 256+256*findLength(&velocity)/3); if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ float gLoc[3]; float vel[3]; gLoc[0]=coords.x; gLoc[1]=coords.y; gLoc[2]=coords.z; vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; if(id==0){ OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); OPENAL_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); } } } while(flamedelay<0&&onfire){ flamedelay+=.006; howmany=abs(Random()%(skeleton.num_joints)); if(!skeleton.free)flatvelocity=(coords-oldcoords)/multiplier/2;//velocity/2; if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2; if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords; if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords; Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1); } while(flamedelay<0&&!onfire&&tutoriallevel==1&&id!=0){ flamedelay+=.05; howmany=abs(Random()%(skeleton.num_joints)); if(!skeleton.free)flatvelocity=(coords-oldcoords)/multiplier/2;//velocity/2; if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2; if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords; if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords; Sprite::MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3); } if(bleeding>0){ bleeding-=multiplier*.3; if(bloodtoggle==2){ glBindTexture(GL_TEXTURE_2D,skeleton.drawmodel.textureptr); if(bleeding<=0&&(detail!=2||osx))DoMipmaps(); } } if(neckspurtamount>0){ neckspurtamount-=multiplier; neckspurtdelay-=multiplier*3; neckspurtparticledelay-=multiplier*3; if(neckspurtparticledelay<0&&neckspurtdelay>2){ spurt=0; bloodvel=0; if(!skeleton.free){ bloodvel.z=5*neckspurtamount; bloodvel=DoRotation(bloodvel,((float)(Random()%100))/40,rotation+((float)(Random()%100))/40,0)*scale; } if(skeleton.free){ bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/40,((float)(Random()%100))/40,0); } if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/40,rotation+((float)(Random()%100))/40,0)*scale; if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/40,((float)(Random()%100))/40,0)*scale; if(skeleton.free)Sprite::MakeSprite(bloodsprite, (skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5)*scale+coords,bloodvel, 1,1,1, .05, .9); if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, .9); neckspurtparticledelay=.05; } if(neckspurtdelay<0){ neckspurtdelay=3; } } if(deathbleeding>0&&dead!=2){ if(deathbleeding<5)bleeddelay-=deathbleeding*multiplier/4; else bleeddelay-=5*multiplier/4; if(bleeddelay<0&&bloodtoggle){ bleeddelay=1; XYZ bloodvel; if(bloodtoggle){ bloodvel=0; if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[abdomen]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; if(skeleton.free)Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1); if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); } } bloodloss+=deathbleeding*multiplier*80; deathbleeding-=multiplier*1.6; //if(id==0)deathbleeding-=multiplier*.2; if(deathbleeding<0)deathbleeding=0; if(bloodloss>damagetolerance&&animation[targetanimation].attack==neutral){ if(weaponactive!=-1){ weapons[weaponids[0]].owner=-1; weapons[weaponids[0]].velocity=velocity*scale*-.3; weapons[weaponids[0]].velocity.x+=.01; weapons[weaponids[0]].tipvelocity=velocity*scale; weapons[weaponids[0]].missed=1; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=1; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; if(weaponstuck==num_weapons)weaponstuck=0; } weaponactive=-1; for(i=0;i.1){ numafterkill++; } RagDoll(0); } } if(texupdatedelay<0&&bleeding>0&&bloodtoggle==2&&findDistancefast(&viewer,&coords)<9){ texupdatedelay=.12; bloodsize=5-realtexdetail; startx=0; starty=0; startx=bleedy;//abs(Random()%(skeleton.skinsize-bloodsize-1)); starty=bleedx;//abs(Random()%(skeleton.skinsize-bloodsize-1)); endx=startx+bloodsize; endy=starty+bloodsize; if(startx<0){startx=0;bleeding=0;} if(starty<0){starty=0;bleeding=0;} if(endx>skeleton.skinsize-1){endx=skeleton.skinsize-1;bleeding=0;} if(endy>skeleton.skinsize-1){endy=skeleton.skinsize-1;bleeding=0;} if(endxcolor/2)skeleton.skinText[i*skeleton.skinsize*3+j*3+0]=color/2; skeleton.skinText[i*skeleton.skinsize*3+j*3+1]=0; skeleton.skinText[i*skeleton.skinsize*3+j*3+2]=0; } } } if(!osx&&detail>1){ glBindTexture(GL_TEXTURE_2D,skeleton.drawmodel.textureptr); DoMipmaps(); } if(!skeleton.free){ bleedy-=4/realtexdetail; if(detail==2)bleedx+=(abs(Random()%3)-1)*2/realtexdetail; else bleedx+=(abs(Random()%3)-1)*4/realtexdetail; } if(skeleton.free){ bleedx+=4*direction/realtexdetail; if(detail==2)bleedy+=(abs(Random()%3)-1)*2/realtexdetail; else bleedy+=(abs(Random()%3)-1)*4/realtexdetail; } } if(abs(righthandmorphness-targetrighthandmorphness)targetrighthandmorphness){ righthandmorphness-=multiplier*4; } else if(righthandmorphnesstargetlefthandmorphness){ lefthandmorphness-=multiplier*4; } else if(lefthandmorphnesstargettailmorphness){ tailmorphness-=multiplier*10; } else if(tailmorphnesstargettailmorphness){ tailmorphness-=multiplier*2; } else if(tailmorphnesstargetheadmorphness){ headmorphness-=multiplier*7; } else if(headmorphnesstargetheadmorphness){ headmorphness-=multiplier*10; } else if(headmorphnesstargetheadmorphness){ headmorphness-=multiplier*4; } else if(headmorphnesstargetchestmorphness){ chestmorphness-=multiplier; } else if(chestmorphnesstypesleeping){ XYZ headpoint; headpoint=coords; if(bloodtoggle&&!bled){ terrain.MakeDecal(blooddecalslow,headpoint,.8,.5,0); } if(bloodtoggle&&!bled) for(l=0;ltypesleeping){ //If dead, open mouth and hands if(righthandmorphend!=0)righthandmorphness=0; righthandmorphend=0; targetrighthandmorphness=1; if(lefthandmorphend!=0)lefthandmorphness=0; lefthandmorphend=0; targetlefthandmorphness=1; if(headmorphend!=2)headmorphness=0; headmorphend=2; targetheadmorphness=1; } if(stunned>0&&!dead&&headmorphend!=2){ if(headmorphend!=4)headmorphness=0; headmorphend=4; targetheadmorphness=1; } if(damage>damagetolerance&&!dead){ dead=1; unconscioustime=0; if(creature==wolftype){ award_bonus(0, Wolfbonus); } RagDoll(0); if(weaponactive!=-1){ weapons[weaponids[0]].owner=-1; weapons[weaponids[0]].velocity=velocity*scale*-.3; weapons[weaponids[0]].velocity.x+=.01; weapons[weaponids[0]].tipvelocity=velocity*scale; weapons[weaponids[0]].missed=1; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=1; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; if(weaponstuck==num_weapons)weaponstuck=0; } weaponactive=-1; for(i=0;idamagetolerance&&dead!=2){ DoBlood(1,255); if(weaponactive!=-1){ weapons[weaponids[0]].owner=-1; weapons[weaponids[0]].velocity=velocity*scale*-.3; weapons[weaponids[0]].velocity.x+=.01; weapons[weaponids[0]].tipvelocity=velocity*scale; weapons[weaponids[0]].missed=1; weapons[weaponids[0]].hitsomething=0; weapons[weaponids[0]].freetime=0; weapons[weaponids[0]].firstfree=1; weapons[weaponids[0]].physics=1; num_weapons--; if(num_weapons){ weaponids[0]=weaponids[num_weapons]; if(weaponstuck==num_weapons)weaponstuck=0; } weaponactive=-1; for(i=0;i1)&&(bonus!=FinishedBonus||bonustime>1)&&bloodloss.1){ numafterkill++; } dead=2; skeleton.free=1; emit_sound_at(breaksound, coords); } if(skeleton.free==1){ if(id==0)pause_sound(whooshsound); if(!dead){ //If knocked over, open hands and close mouth if(righthandmorphend!=0)righthandmorphness=0; righthandmorphend=0; targetrighthandmorphness=1; if(lefthandmorphend!=0)lefthandmorphness=0; lefthandmorphend=0; targetlefthandmorphness=1; if(headmorphend!=3&&headmorphend!=5&&headmorphstart!=3&&headmorphstart!=5){ if(headmorphend!=0)headmorphness=0; headmorphend=0; targetheadmorphness=1; } } skeleton.DoGravity(&scale); float damageamount; damageamount=skeleton.DoConstraints(&coords,&scale)*5; if(damage>damagetolerance-damageamount&&!dead&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=style||bonustime>1)&&(bonus!=cannon||bonustime>1)) award_bonus(id, deepimpact); DoDamage(damageamount/((protectionhigh+protectionhead+protectionlow)/3)); average=0; howmany=0; for(j=0;j2000){ if(skeleton.longdead>6000){ if(id==0)pause_sound(whooshsound); skeleton.free=3; DrawSkeleton(); skeleton.free=2; } if(dead==2&&bloodloss=damagetolerance){ XYZ headpoint; headpoint=(skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2*scale+coords; if(bleeding<=0)DoBlood(1,255); if(bloodtoggle&&!bled){ terrain.MakeDecal(blooddecalslow,headpoint,.8,.5,0); } if(bloodtoggle&&!bled) for(l=0;l.5&&id==0&&skeleton.free){ bool canrecover=1; XYZ startpoint,endpoint,colpoint,colviewer,coltarget; startpoint=coords; endpoint=coords; endpoint.y-=.7; if(terrain.lineTerrain(startpoint,endpoint,&colpoint)!=-1)canrecover=0; if(velocity.y<-30)canrecover=0; for(i=0;i0)targetoffset.y=middle.y+1; for(i=0;i(damage+500)*1.5){ if(id==0)pause_sound(whooshsound); skeleton.free=0; velocity=0; XYZ middle; middle=0; terrainnormal=skeleton.joints[skeleton.jointlabels[groin]].position-skeleton.joints[skeleton.jointlabels[abdomen]].position; if(skeleton.joints[skeleton.jointlabels[groin]].locked&&skeleton.joints[skeleton.jointlabels[abdomen]].locked){ terrainnormal=skeleton.joints[skeleton.jointlabels[groin]].position-skeleton.joints[skeleton.jointlabels[abdomen]].position; middle=(skeleton.joints[skeleton.jointlabels[groin]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2; } if(skeleton.joints[skeleton.jointlabels[abdomen]].locked&&skeleton.joints[skeleton.jointlabels[neck]].locked){ terrainnormal=skeleton.joints[skeleton.jointlabels[abdomen]].position-skeleton.joints[skeleton.jointlabels[neck]].position; middle=(skeleton.joints[skeleton.jointlabels[neck]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2; } if(skeleton.joints[skeleton.jointlabels[groin]].locked&&skeleton.joints[skeleton.jointlabels[neck]].locked){ terrainnormal=skeleton.joints[skeleton.jointlabels[groin]].position-skeleton.joints[skeleton.jointlabels[neck]].position; middle=(skeleton.joints[skeleton.jointlabels[groin]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2; } Normalise(&terrainnormal); targetrotation=-asin(0-terrainnormal.x); targetrotation*=360/6.28; if(terrainnormal.z<0)targetrotation=180-targetrotation; rotation=targetrotation; targettilt2=asin(terrainnormal.y)*180/3.14*-1; if(skeleton.forward.y<0){ targetanimation=getupfrombackanim; targetframe=0; targettilt2=0; } if(skeleton.forward.y>-.3){ targetanimation=getupfromfrontanim; rotation+=180; targetrotation+=180; targettilt2*=-1; targetframe=0; targettilt2=0; } if((Random()%8==0&&id!=0&&creature==rabbittype)||(Random()%2==0&&id!=0&&creature==wolftype)||(id==0&&crouchkeydown&&(forwardkeydown||backkeydown||leftkeydown||rightkeydown))){ targetanimation=rollanim; targetrotation=lookrotation; if(id==0){ if(rightkeydown){ targetrotation-=90; if(forwardkeydown)targetrotation+=45; if(backkeydown)targetrotation-=45; } if(leftkeydown){ targetrotation+=90; if(forwardkeydown)targetrotation-=45; if(backkeydown)targetrotation+=45; } if(backkeydown){ if ( !leftkeydown&&!rightkeydown) targetrotation+=180; } targetrotation+=180; } } if(abs(targettilt2)>50)targettilt2=0; currentanimation=tempanim; currentframe=0; target=0; tilt2=targettilt2; if(middle.y>0&&targetanimation!=rollanim)targetoffset.y=middle.y+1; for(i=0;i0)if(weapons[0].getType()==staff)hasstaff=1; if(!skeleton.freefall&&freefall&&((jumpkeydown&&jumpkeydowntime<.2)||(hasstaff&&rabbitkickragdoll))&&!dead){ if(velocity.y>-30){ XYZ tempvelocity; tempvelocity=velocity; Normalise(&tempvelocity); targetrotation=-asin(0-tempvelocity.x); targetrotation*=360/6.28; if(velocity.z<0)targetrotation=180-targetrotation; //targetrotation+=180; skeleton.free=0; if(dotproduct(&skeleton.forward,&tempvelocity)<0){ targetanimation=rollanim; targetframe=2; } else{ targetanimation=backhandspringanim; targetrotation+=180; targetframe=6; } target=0; emit_sound_at(movewhooshsound, coords, 128.); currentanimation=targetanimation; currentframe=targetframe-1; target=0; velocity=0; rotation=targetrotation; tilt=0; targettilt=0; tilt2=0; targettilt2=0; } } if(skeleton.freefall==0)freefall=0; } if(aitype!=passivetype||skeleton.free==1) if(findLengthfast(&velocity)>.1) for(i=0;iobjects.position[i].y+3*objects.scale[i]){ if(objects.messedwith[i]<=0){ XYZ tempvel; XYZ pos; emit_sound_at(bushrustle, coords, 40*findLength(&velocity)); if(id==0){ envsound[numenvsounds]=coords; envsoundvol[numenvsounds]=4*findLength(&velocity); envsoundlife[numenvsounds]=.4; numenvsounds++; } int howmany; if(environment==grassyenvironment)howmany=findLength(&velocity)*4; if(environment==snowyenvironment)howmany=findLength(&velocity)*2; if(detail==2) if(environment!=desertenvironment) for(j=0;j0||surprised>0)&&numplayers>2&&aitype!=passivetype)play=1; if(hasvictim) if(aitype!=passivetype&&victim->skeleton.free&&!victim->dead)play=1; if(tutoriallevel==1&&id!=0)play=0; if(play&&aitype!=playercontrolled){ int whichsound=-1; i=abs(Random()%4); if(speechdelay<=0){ if(creature==rabbittype){ if(i==0)whichsound=rabbitchitter; if(i==1)whichsound=rabbitchitter2; } if(creature==wolftype){ if(i==0)whichsound=growlsound; if(i==1)whichsound=growl2sound; } } speechdelay=.3; if(whichsound!=-1){ emit_sound_at(whichsound, coords); } } if(targetanimation==staggerbackhighanim)staggerdelay=1; if(targetanimation==staggerbackhardanim)staggerdelay=1; staggerdelay-=multiplier; if(targetanimation!=crouchstabanim&&targetanimation!=swordgroundstabanim&&targetanimation!=staffgroundsmashanim)hasvictim=1; if(velocity.y<-30&&targetanimation==jumpdownanim)RagDoll(0); if(currentanimation!=getIdle()&&wasIdle()&&targetanimation!=getIdle()&&isIdle()){ targetanimation=getIdle(); targetframe=0; target=0; } weaponmissdelay-=multiplier; highreversaldelay-=multiplier; lowreversaldelay-=multiplier; lastcollide-=multiplier; skiddelay-=multiplier; if(!isnormal(velocity.x)&&velocity.x){ velocity=0; } if(!isnormal(targettilt)&&targettilt){ targettilt=0; } if(!isnormal(targettilt2)&&targettilt2){ targettilt2=0; } if(!isnormal(targetrotation)&&targetrotation){ targetrotation=0; } if(targetanimation==bounceidleanim||targetanimation==wolfidle||targetanimation==walkanim||targetanimation==drawrightanim||targetanimation==crouchdrawrightanim||targetanimation==drawleftanim||targetanimation==fightidleanim||targetanimation==fightsidestep||targetanimation==hanganim||isCrouch()||targetanimation==backhandspringanim){ //open hands and close mouth if(righthandmorphend!=0&&righthandmorphness==targetrighthandmorphness){ righthandmorphness=0; righthandmorphend=0; targetrighthandmorphness=1; } if(lefthandmorphend!=0&&lefthandmorphness==targetlefthandmorphness){ lefthandmorphness=0; lefthandmorphend=0; targetlefthandmorphness=1; } if(headmorphend!=3&&headmorphend!=5&&headmorphstart!=3&&headmorphstart!=5&&headmorphend!=0&&headmorphness==targetheadmorphness){ headmorphness=0; headmorphend=0; targetheadmorphness=1; } } if(targetanimation==rollanim||targetanimation==dodgebackanim||targetanimation==removeknifeanim||targetanimation==knifefightidleanim||targetanimation==swordfightidleanim||targetanimation==blockhighleftstrikeanim||targetanimation==crouchremoveknifeanim||targetanimation==sneakanim||targetanimation==sweepanim||targetanimation==spinkickreversedanim||targetanimation==jumpdownanim||isWallJump()||isFlip()||targetanimation==climbanim||isRun()||targetanimation==getupfrombackanim||targetanimation==getupfromfrontanim){ //open hands and mouth if(righthandmorphend!=0&&righthandmorphness==targetrighthandmorphness){ righthandmorphness=0; righthandmorphend=0; targetrighthandmorphness=1; } if(lefthandmorphend!=0&&lefthandmorphness==targetlefthandmorphness){ lefthandmorphness=0; lefthandmorphend=0; targetlefthandmorphness=1; } if(headmorphend!=1&&headmorphness==targetheadmorphness){ headmorphness=0; headmorphend=1; targetheadmorphness=1; } } if(targetanimation==jumpupanim||targetanimation==crouchstabanim||targetanimation==swordgroundstabanim||targetanimation==swordfightidlebothanim||targetanimation==blockhighleftanim||targetanimation==blockhighleftanim){ //close hands and mouth if(righthandmorphend!=1&&righthandmorphness==targetrighthandmorphness){ righthandmorphness=0; righthandmorphend=1; targetrighthandmorphness=1; } if(lefthandmorphend!=1&&lefthandmorphness==targetlefthandmorphness){ lefthandmorphness=0; lefthandmorphend=1; targetlefthandmorphness=1; } if(headmorphend!=0&&headmorphness==targetheadmorphness){ headmorphness=0; headmorphend=0; targetheadmorphness=1; } } if(targetanimation==spinkickanim||targetanimation==staffspinhitreversalanim||targetanimation==staffspinhitreversedanim||targetanimation==staffhitreversalanim||targetanimation==staffhitreversedanim||targetanimation==hurtidleanim||targetanimation==winduppunchanim||targetanimation==swordslashreversalanim||targetanimation==swordslashreversedanim||targetanimation==knifeslashreversalanim||targetanimation==knifeslashreversedanim||targetanimation==knifethrowanim||targetanimation==knifefollowanim||targetanimation==knifefollowedanim||targetanimation==killanim||targetanimation==dropkickanim||targetanimation==upunchanim||targetanimation==knifeslashstartanim||targetanimation==swordslashanim||targetanimation==staffhitanim||targetanimation==staffspinhitanim||targetanimation==staffgroundsmashanim||targetanimation==spinkickreversalanim||targetanimation==sweepreversalanim||targetanimation==lowkickanim||targetanimation==sweepreversedanim||targetanimation==rabbitkickreversalanim||targetanimation==rabbitkickreversedanim||targetanimation==jumpreversalanim||targetanimation==jumpreversedanim){ //close hands and yell if(righthandmorphend!=1&&righthandmorphness==targetrighthandmorphness){ righthandmorphness=0; righthandmorphend=1; targetrighthandmorphness=1; } if(lefthandmorphend!=1&&lefthandmorphness==targetlefthandmorphness){ lefthandmorphness=0; lefthandmorphend=1; targetlefthandmorphness=1; } if(headmorphend!=2&&headmorphness==targetheadmorphness){ headmorphness=1; headmorphend=2; targetheadmorphness=1; } } bool behind; behind=0; if(hasvictim){ if(victim!=this&&!victim->dead&&victim->aitype!=passivetype&&victim->aitype!=searchtype&&aitype!=passivetype&&aitype!=searchtype&&victim->idcoords)>0); } } if(!dead&&targetanimation!=hurtidleanim) if(behind||targetanimation==killanim||targetanimation==knifethrowanim||targetanimation==knifefollowanim||targetanimation==spinkickreversalanim||targetanimation==rabbitkickreversedanim||targetanimation==jumpreversedanim){ if(headmorphend!=4||headmorphness==targetheadmorphness){ headmorphend=4; //headmorphness=1; targetheadmorphness=1; } } if(weaponactive!=-1){ if(weapons[weaponids[weaponactive]].getType()!=staff){ righthandmorphstart=1; righthandmorphend=1; } if(weapons[weaponids[weaponactive]].getType()==staff){ righthandmorphstart=2; righthandmorphend=2; } targetrighthandmorphness=1; } terrainnormal=terrain.getNormal(coords.x,coords.z); if(animation[targetanimation].attack!=reversal){ if(!isnormal(coords.x)) coords=oldcoords; oldcoords=coords; } flatfacing=0; flatfacing.z=1; flatfacing=DoRotation(flatfacing,0,rotation,0); facing=flatfacing; ReflectVector(&facing,terrainnormal); Normalise(&facing); if(isRun()||targetanimation==sneakanim||targetanimation==rollanim||targetanimation==walkanim){ if(onterrain)targettilt2=-facing.y*20; else targettilt2=0; } onterrain=0; if(!isRun()&&!animation[targetanimation].attack&&targetanimation!=getupfromfrontanim&&targetanimation!=getupfrombackanim&&targetanimation!=sneakanim)targettilt2=0; if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ flatvelocity=velocity; flatvelocity.y=0; flatvelspeed=findLength(&flatvelocity); targettilt=flatvelspeed*fast_sqrt(abs(velocity.y)*.7)*normaldotproduct(DoRotation(flatfacing,0,-90,0),flatvelocity); targettilt2=flatvelspeed*fast_sqrt(abs(velocity.y)*.7)*normaldotproduct(flatfacing,flatvelocity); if(velocity.y<0)targettilt2*=-1; if(velocity.y<0)targettilt*=-1; if(targettilt>25)targettilt=25; if(targettilt<-25)targettilt=-25; } if(targettilt2>45)targettilt2=45; if(targettilt2<-45)targettilt2=-45; if(abs(tilt2-targettilt2)targettilt2){ tilt2-=multiplier*400; } else if(tilt225)tilt2=25; if(tilt2<-25)tilt2=-25; } if(!isnormal(targettilt)&&targettilt){ targettilt=0; } if(!isnormal(targettilt2)&&targettilt2){ targettilt2=0; } //Running velocity //if(!creature==wolftype||targetanimation==rabbitkickanim) if(targetanimation==rabbittackleanim){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*65*scale){ velocity/=velspeed; velspeed=speed*65*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if(targetanimation!=rabbitrunninganim&&targetanimation!=wolfrunninganim){ if(isRun()||targetanimation==rabbitkickanim){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*45*scale){ velocity/=velspeed; velspeed=speed*45*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); if(velspeedspeed*55*scale){ velocity/=velspeed; velspeed=speed*55*scale; velocity*=velspeed; } } if(creature==wolftype){ if(velspeed>speed*75*scale){ velocity/=velspeed; velspeed=speed*75*scale; velocity*=velspeed; } } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if(targetanimation==rollanim&&animation[targetanimation].label[targetframe]!=6){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*45*scale){ velocity/=velspeed; velspeed=speed*45*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } /*if(currentanimation==rollanim&&(isCrouch()||isIdle())){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*25*scale){ velocity/=velspeed; velspeed=speed*25*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; }*/ if(targetanimation==sneakanim||targetanimation==walkanim){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*12*scale){ velocity/=velspeed; velspeed=speed*12*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if((targetanimation==fightidleanim||targetanimation==knifefightidleanim)&&(currentanimation==bounceidleanim||currentanimation==hurtidleanim)){ velocity+=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*2*scale){ velocity/=velspeed; velspeed=speed*2*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if((targetanimation==bounceidleanim||currentanimation==hurtidleanim)&&(currentanimation==fightidleanim||currentanimation==knifefightidleanim)){ velocity-=facing*multiplier*speed*700*scale; velspeed=findLength(&velocity); if(velspeed>speed*2*scale){ velocity/=velspeed; velspeed=speed*2*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==fightsidestep){ velocity+=DoRotation(facing*multiplier*speed*700*scale,0,-90,0); velspeed=findLength(&velocity); if(velspeed>speed*12*scale){ velocity/=velspeed; velspeed=speed*12*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=DoRotation(flatfacing*velspeed,0,-90,0); } if(targetanimation==staggerbackhighanim){ coords-=facing*multiplier*speed*16*scale; velocity=0; } if(targetanimation==staggerbackhardanim&&animation[staggerbackhardanim].label[targetframe]!=6){ coords-=facing*multiplier*speed*20*scale; velocity=0; } if(targetanimation==backhandspringanim){ //coords-=facing*multiplier*50*scale; velocity+=facing*multiplier*speed*700*scale*-1; velspeed=findLength(&velocity); if(velspeed>speed*50*scale){ velocity/=velspeed; velspeed=speed*50*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==dodgebackanim){ //coords-=facing*multiplier*50*scale; velocity+=facing*multiplier*speed*700*scale*-1; velspeed=findLength(&velocity); if(velspeed>speed*60*scale){ velocity/=velspeed; velspeed=speed*60*scale; velocity*=velspeed; } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ velspeed=findLength(&velocity); } if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ velocity.y+=gravity*multiplier; } if(targetanimation!=climbanim&&targetanimation!=hanganim&&!isWallJump())coords+=velocity*multiplier; if(coords.y5&&(isLanding()||isLandhard())){ skiddingdelay+=multiplier; if(skiddelay<=0){ FootLand(0,.5); FootLand(1,.5); skiddelay=.02; } } else skiddingdelay=0; } if(isLandhard()){ velspeed=findLength(&velocity); velocity.y=0; if(velspeed5&&(isLanding()||isLandhard())){ skiddingdelay+=multiplier; if(skiddelay<=0){ FootLand(0,.5); FootLand(1,.5); skiddelay=.02; } } else skiddingdelay=0; } if(skiddingdelay<0)skiddingdelay+=multiplier; if(skiddingdelay>.02&&!forwardkeydown&&!backkeydown&&!leftkeydown&&!rightkeydown&&!jumpkeydown&&isLanding()&&!landhard){ skiddingdelay=-1; if(!onterrain||environment==grassyenvironment){ emit_sound_at(skidsound, coords, 128*velspeed/10); } else { emit_sound_at(snowskidsound, coords, 128*velspeed/10); } } if(animation[targetanimation].attack==normalattack&&targetanimation!=rabbitkickanim&&!victim->skeleton.free){ terrainnormal=victim->coords-coords; Normalise(&terrainnormal); targetrotation=-asin(0-terrainnormal.x); targetrotation*=360/6.28; if(terrainnormal.z<0)targetrotation=180-targetrotation; targettilt2=-asin(terrainnormal.y)*360/6.28;//*-70; } if(animation[targetanimation].attack==reversal&&targetanimation!=rabbittacklinganim){ targetrotation=victim->targetrotation; } if(targetanimation==rabbittacklinganim){ coords=victim->coords; } } skeleton.oldfree=skeleton.free; XYZ midterrain; midterrain=0; midterrain.x=terrain.size*terrain.scale/2; midterrain.z=terrain.size*terrain.scale/2; if(findDistancefastflat(&coords,&midterrain)>(terrain.size*terrain.scale/2-viewdistance)*(terrain.size*terrain.scale/2-viewdistance)){ XYZ tempposit; tempposit=coords-midterrain; tempposit.y=0; Normalise(&tempposit); tempposit*=(terrain.size*terrain.scale/2-viewdistance); coords.x=tempposit.x+midterrain.x; coords.z=tempposit.z+midterrain.z; } } int Person::DrawSkeleton(){ int oldplayerdetail; if((frustum.SphereInFrustum(coords.x,coords.y+scale*3,coords.z,scale*8)&&findDistancefast(&viewer,&coords)0&&playerdetail)||(skeleton.muscles[i].numverticeslow>0&&!playerdetail)){ morphness=0; start=0; endthing=0; if(skeleton.muscles[i].parent1->label==righthand||skeleton.muscles[i].parent2->label==righthand){ morphness=righthandmorphness; start=righthandmorphstart; endthing=righthandmorphend; } if(skeleton.muscles[i].parent1->label==lefthand||skeleton.muscles[i].parent2->label==lefthand){ morphness=lefthandmorphness; start=lefthandmorphstart; endthing=lefthandmorphend; } if(skeleton.muscles[i].parent1->label==head||skeleton.muscles[i].parent2->label==head){ morphness=headmorphness; start=headmorphstart; endthing=headmorphend; } if((skeleton.muscles[i].parent1->label==neck&&skeleton.muscles[i].parent2->label==abdomen)||(skeleton.muscles[i].parent2->label==neck&&skeleton.muscles[i].parent1->label==abdomen)){ morphness=chestmorphness; start=chestmorphstart; endthing=chestmorphend; } if((skeleton.muscles[i].parent1->label==groin&&skeleton.muscles[i].parent2->label==abdomen)||(skeleton.muscles[i].parent2->label==groin&&skeleton.muscles[i].parent1->label==abdomen)){ morphness=tailmorphness; start=tailmorphstart; endthing=tailmorphend; } if(calcrot)skeleton.FindRotationMuscle(i,targetanimation); mid=(skeleton.muscles[i].parent1->position+skeleton.muscles[i].parent2->position)/2; glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glLoadIdentity(); if(!skeleton.free)glRotatef(tilt2,1,0,0); if(!skeleton.free)glRotatef(tilt,0,0,1); glTranslatef(mid.x,mid.y,mid.z); skeleton.muscles[i].lastrotate1=skeleton.muscles[i].rotate1; glRotatef(-skeleton.muscles[i].lastrotate1+90,0,1,0); skeleton.muscles[i].lastrotate2=skeleton.muscles[i].rotate2; glRotatef(-skeleton.muscles[i].lastrotate2+90,0,0,1); skeleton.muscles[i].lastrotate3=skeleton.muscles[i].rotate3; glRotatef(-skeleton.muscles[i].lastrotate3,0,1,0); if(playerdetail||skeleton.free==3) { for(j=0;jlabel==abdomen||skeleton.muscles[i].parent2->label==abdomen) glTranslatef((skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].x*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].x*morphness)*proportionbody.x, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].y*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].y*morphness)*proportionbody.y, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].z*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].z*morphness)*proportionbody.z); if(skeleton.muscles[i].parent1->label==lefthand||skeleton.muscles[i].parent1->label==righthand||skeleton.muscles[i].parent1->label==leftwrist||skeleton.muscles[i].parent1->label==rightwrist||skeleton.muscles[i].parent1->label==leftelbow||skeleton.muscles[i].parent1->label==rightelbow||skeleton.muscles[i].parent2->label==leftelbow||skeleton.muscles[i].parent2->label==rightelbow) glTranslatef((skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].x*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].x*morphness)*proportionarms.x, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].y*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].y*morphness)*proportionarms.y, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].z*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].z*morphness)*proportionarms.z); if(skeleton.muscles[i].parent1->label==leftfoot||skeleton.muscles[i].parent1->label==rightfoot||skeleton.muscles[i].parent1->label==leftankle||skeleton.muscles[i].parent1->label==rightankle||skeleton.muscles[i].parent1->label==leftknee||skeleton.muscles[i].parent1->label==rightknee||skeleton.muscles[i].parent2->label==leftknee||skeleton.muscles[i].parent2->label==rightknee) glTranslatef((skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].x*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].x*morphness)*proportionlegs.x, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].y*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].y*morphness)*proportionlegs.y, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].z*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].z*morphness)*proportionlegs.z); if(skeleton.muscles[i].parent1->label==head||skeleton.muscles[i].parent2->label==head) glTranslatef((skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].x*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].x*morphness)*proportionhead.x, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].y*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].y*morphness)*proportionhead.y, (skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].z*(1-morphness)+skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].z*morphness)*proportionhead.z); glGetFloatv(GL_MODELVIEW_MATRIX,M); //if(!isnormal(M[12])||!isnormal(M[13])||!isnormal(M[14]))test=0; //if(!isnormal(scale))test=1; skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].x=M[12]*scale; skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].y=M[13]*scale; skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].z=M[14]*scale; //test=2; glPopMatrix(); } } if(!playerdetail||skeleton.free==3) { for(j=0;jlabel==abdomen||skeleton.muscles[i].parent2->label==abdomen) glTranslatef((skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].x)*proportionbody.x, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].y)*proportionbody.y, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].z)*proportionbody.z); if(skeleton.muscles[i].parent1->label==lefthand||skeleton.muscles[i].parent1->label==righthand||skeleton.muscles[i].parent1->label==leftwrist||skeleton.muscles[i].parent1->label==rightwrist||skeleton.muscles[i].parent1->label==leftelbow||skeleton.muscles[i].parent1->label==rightelbow||skeleton.muscles[i].parent2->label==leftelbow||skeleton.muscles[i].parent2->label==rightelbow) glTranslatef((skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].x)*proportionarms.x, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].y)*proportionarms.y, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].z)*proportionarms.z); if(skeleton.muscles[i].parent1->label==leftfoot||skeleton.muscles[i].parent1->label==rightfoot||skeleton.muscles[i].parent1->label==leftankle||skeleton.muscles[i].parent1->label==rightankle||skeleton.muscles[i].parent1->label==leftknee||skeleton.muscles[i].parent1->label==rightknee||skeleton.muscles[i].parent2->label==leftknee||skeleton.muscles[i].parent2->label==rightknee) glTranslatef((skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].x)*proportionlegs.x, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].y)*proportionlegs.y, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].z)*proportionlegs.z); if(skeleton.muscles[i].parent1->label==head||skeleton.muscles[i].parent2->label==head) glTranslatef((skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].x)*proportionhead.x, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].y)*proportionhead.y, (skeleton.modellow.vertex[skeleton.muscles[i].verticeslow[j]].z)*proportionhead.z); glGetFloatv(GL_MODELVIEW_MATRIX,M); skeleton.drawmodellow.vertex[skeleton.muscles[i].verticeslow[j]].x=M[12]*scale; skeleton.drawmodellow.vertex[skeleton.muscles[i].verticeslow[j]].y=M[13]*scale; skeleton.drawmodellow.vertex[skeleton.muscles[i].verticeslow[j]].z=M[14]*scale; glPopMatrix(); } } glPopMatrix(); } if(skeleton.clothes&&skeleton.muscles[i].numverticesclothes>0){ mid=(skeleton.muscles[i].parent1->position+skeleton.muscles[i].parent2->position)/2; glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glLoadIdentity(); if(!skeleton.free)glRotatef(tilt2,1,0,0); if(!skeleton.free)glRotatef(tilt,0,0,1); glTranslatef(mid.x,mid.y,mid.z); skeleton.muscles[i].lastrotate1=skeleton.muscles[i].rotate1; glRotatef(-skeleton.muscles[i].lastrotate1+90,0,1,0); skeleton.muscles[i].lastrotate2=skeleton.muscles[i].rotate2; glRotatef(-skeleton.muscles[i].lastrotate2+90,0,0,1); skeleton.muscles[i].lastrotate3=skeleton.muscles[i].rotate3; glRotatef(-skeleton.muscles[i].lastrotate3,0,1,0); for(j=0;jlabel==abdomen||skeleton.muscles[i].parent2->label==abdomen) glTranslatef((skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].x)*proportionbody.x, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].y)*proportionbody.y, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].z)*proportionbody.z); if(skeleton.muscles[i].parent1->label==lefthand||skeleton.muscles[i].parent1->label==righthand||skeleton.muscles[i].parent1->label==leftwrist||skeleton.muscles[i].parent1->label==rightwrist||skeleton.muscles[i].parent1->label==leftelbow||skeleton.muscles[i].parent1->label==rightelbow||skeleton.muscles[i].parent2->label==leftelbow||skeleton.muscles[i].parent2->label==rightelbow) glTranslatef((skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].x)*proportionarms.x, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].y)*proportionarms.y, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].z)*proportionarms.z); if(skeleton.muscles[i].parent1->label==leftfoot||skeleton.muscles[i].parent1->label==rightfoot||skeleton.muscles[i].parent1->label==leftankle||skeleton.muscles[i].parent1->label==rightankle||skeleton.muscles[i].parent1->label==leftknee||skeleton.muscles[i].parent1->label==rightknee||skeleton.muscles[i].parent2->label==leftknee||skeleton.muscles[i].parent2->label==rightknee) glTranslatef((skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].x)*proportionlegs.x, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].y)*proportionlegs.y, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].z)*proportionlegs.z); if(skeleton.muscles[i].parent1->label==head||skeleton.muscles[i].parent2->label==head) glTranslatef((skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].x)*proportionhead.x, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].y)*proportionhead.y, (skeleton.modelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].z)*proportionhead.z); glGetFloatv(GL_MODELVIEW_MATRIX,M); skeleton.drawmodelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].x=M[12]*scale; skeleton.drawmodelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].y=M[13]*scale; skeleton.drawmodelclothes.vertex[skeleton.muscles[i].verticesclothes[j]].z=M[14]*scale; glPopMatrix(); } glPopMatrix(); } updatedelay=1+(float)(Random()%100)/1000; } if(skeleton.free!=2&&(skeleton.free==1||skeleton.free==3||id==0||(normalsupdatedelay<=0)||targetanimation==getupfromfrontanim||targetanimation==getupfrombackanim||currentanimation==getupfromfrontanim||currentanimation==getupfrombackanim)){ normalsupdatedelay=1; if(playerdetail||skeleton.free==3)skeleton.drawmodel.CalculateNormals(0); if(!playerdetail||skeleton.free==3)skeleton.drawmodellow.CalculateNormals(0); if(skeleton.clothes)skeleton.drawmodelclothes.CalculateNormals(0); } else { if(playerdetail||skeleton.free==3)skeleton.drawmodel.UpdateVertexArrayNoTexNoNorm(); if(!playerdetail||skeleton.free==3)skeleton.drawmodellow.UpdateVertexArrayNoTexNoNorm(); if(skeleton.clothes){ skeleton.drawmodelclothes.UpdateVertexArrayNoTexNoNorm(); } } } framemult=.01; updatedelaychange=-framemult*4*(45-findDistance(&viewer,&coords)*1); if(updatedelaychange>-realmultiplier*30)updatedelaychange=-realmultiplier*30; if(updatedelaychange>-framemult*4)updatedelaychange=-framemult*4; if(skeleton.free==1)updatedelaychange*=6; if(id==0)updatedelaychange*=8; updatedelay+=updatedelaychange; glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); if(!skeleton.free)glTranslatef(coords.x,coords.y-.02,coords.z); if(skeleton.free)glTranslatef(coords.x,coords.y-.02,coords.z); if(!skeleton.free)glTranslatef(offset.x*scale,offset.y*scale,offset.z*scale); if(!skeleton.free)glRotatef(rotation,0,1,0); if(showpoints){ glPointSize(5); glColor4f(.4,1,.4,1); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glBegin(GL_POINTS); if(playerdetail) for(i=0;i1)distance=1; if(distance>0){ terrainheight=(coords.y-terrain.getHeight(coords.x,coords.z))/3+1; if(terrainheight<1)terrainheight=1; if(terrainheight>1.7)terrainheight=1.7; //burnt=0; glColor4f((1-(1-terrainlight.x)/terrainheight)-burnt,(1-(1-terrainlight.y)/terrainheight)-burnt,(1-(1-terrainlight.z)/terrainheight)-burnt,distance); glDisable(GL_BLEND); glAlphaFunc(GL_GREATER, 0.0001); glEnable(GL_TEXTURE_2D); if(cellophane){ glDisable(GL_TEXTURE_2D); glColor4f(.7,.35,0,.5); glDepthMask(0); glEnable(GL_LIGHTING); glEnable(GL_BLEND); } if(tutoriallevel&&id!=0){ //glDisable(GL_TEXTURE_2D); glColor4f(.7,.7,.7,0.6); glDepthMask(0); glEnable(GL_LIGHTING); glEnable(GL_BLEND); if(canattack&&cananger) if(animation[targetanimation].attack==normalattack||animation[targetanimation].attack==reversed){ glDisable(GL_TEXTURE_2D); glColor4f(1,0,0,0.8); } glMatrixMode(GL_TEXTURE); glPushMatrix(); glTranslatef(0,-smoketex,0); glTranslatef(-smoketex,0,0); } if(playerdetail){ if(!showpoints){ if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture); else skeleton.drawmodel.draw(); } } if(!playerdetail){ if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture); else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr); } if(!(animation[targetanimation].attack==normalattack||animation[targetanimation].attack==reversed)) if(tutoriallevel&&id!=0){ glPopMatrix(); glMatrixMode(GL_MODELVIEW); glEnable(GL_TEXTURE_2D); glColor4f(.7,.7,.7,0.6); glDepthMask(0); glEnable(GL_LIGHTING); glEnable(GL_BLEND); if(canattack&&cananger) if(animation[targetanimation].attack==normalattack||animation[targetanimation].attack==reversed){ glDisable(GL_TEXTURE_2D); glColor4f(1,0,0,0.8); } glMatrixMode(GL_TEXTURE); glPushMatrix(); glTranslatef(0,-smoketex*.6,0); glTranslatef(smoketex*.6,0,0); if(playerdetail){ if(!showpoints){ if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture); else skeleton.drawmodel.draw(); } } if(!playerdetail){ if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture); else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr); } } if(tutoriallevel&&id!=0){ glPopMatrix(); glMatrixMode(GL_MODELVIEW); glEnable(GL_TEXTURE_2D); } if(skeleton.clothes){ glDepthMask(0); glEnable(GL_BLEND); if(!immediate)skeleton.drawmodelclothes.draw(); if(immediate)skeleton.drawmodelclothes.drawimmediate(); glDepthMask(1); } } glPopMatrix(); if(num_weapons>0){ for(k=0;klabel==righthand||skeleton.muscles[j].parent2->label==righthand)&&skeleton.muscles[j].numvertices>0){ weaponattachmuscle=j; } } for(j=0;jlabel==rightwrist||skeleton.muscles[j].parent2->label==rightwrist)&&(skeleton.muscles[j].parent1->label!=righthand&&skeleton.muscles[j].parent2->label!=righthand)&&skeleton.muscles[j].numvertices>0){ weaponrotatemuscle=j; } } weaponpoint=(skeleton.muscles[weaponattachmuscle].parent1->position+skeleton.muscles[weaponattachmuscle].parent2->position)/2; if(creature==wolftype)weaponpoint=(skeleton.joints[skeleton.jointlabels[rightwrist]].position*.7+skeleton.joints[skeleton.jointlabels[righthand]].position*.3); } if(weapons[i].getType()==staff){ for(j=0;jlabel==righthand||skeleton.muscles[j].parent2->label==righthand)&&skeleton.muscles[j].numvertices>0){ weaponattachmuscle=j; } } for(j=0;jlabel==rightelbow||skeleton.muscles[j].parent2->label==rightelbow)&&(skeleton.muscles[j].parent1->label!=rightshoulder&&skeleton.muscles[j].parent2->label!=rightshoulder)&&skeleton.muscles[j].numvertices>0){ weaponrotatemuscle=j; } } //weaponpoint=skeleton.joints[skeleton.jointlabels[rightwrist]].position; weaponpoint=(skeleton.muscles[weaponattachmuscle].parent1->position+skeleton.muscles[weaponattachmuscle].parent2->position)/2; //weaponpoint+=skeleton.specialforward[1]*.1+(skeleton.joints[skeleton.jointlabels[rightwrist]].position-skeleton.joints[skeleton.jointlabels[rightelbow]].position); XYZ tempnormthing,vec1,vec2; vec1=(skeleton.joints[skeleton.jointlabels[rightwrist]].position-skeleton.joints[skeleton.jointlabels[rightelbow]].position); vec2=(skeleton.joints[skeleton.jointlabels[rightwrist]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position); CrossProduct(&vec1,&vec2,&tempnormthing); Normalise(&tempnormthing); if(targetanimation!=staffhitanim&¤tanimation!=staffhitanim&&targetanimation!=staffgroundsmashanim&¤tanimation!=staffgroundsmashanim&&targetanimation!=staffspinhitanim&¤tanimation!=staffspinhitanim)weaponpoint+=tempnormthing*.1-skeleton.specialforward[1]*.3+(skeleton.joints[skeleton.jointlabels[rightwrist]].position-skeleton.joints[skeleton.jointlabels[rightelbow]].position); } } if(weaponactive!=k&&weaponstuck!=k){ if(weapons[i].getType()==knife)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[righthip]].position-skeleton.joints[skeleton.jointlabels[lefthip]].position)*.1+(skeleton.joints[skeleton.jointlabels[rightshoulder]].position-skeleton.joints[skeleton.jointlabels[leftshoulder]].position)*.35; if(weapons[i].getType()==sword)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33; if(weapons[i].getType()==staff)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33; for(j=0;jlabel==abdomen||skeleton.muscles[j].parent2->label==abdomen)&&(skeleton.muscles[j].parent1->label==neck||skeleton.muscles[j].parent2->label==neck)&&skeleton.muscles[j].numvertices>0){ weaponrotatemuscle=j; } } } if(weaponstuck==k){ if(weaponstuckwhere==0)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5-skeleton.forward*.8; else weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5+skeleton.forward*.8; for(j=0;jlabel==abdomen||skeleton.muscles[j].parent2->label==abdomen)&&(skeleton.muscles[j].parent1->label==neck||skeleton.muscles[j].parent2->label==neck)&&skeleton.muscles[j].numvertices>0){ weaponrotatemuscle=j; } } } if(skeleton.free){ weapons[i].position=weaponpoint*scale+coords; weapons[i].bigrotation=0; weapons[i].bigtilt=0; weapons[i].bigtilt2=0; } else { weapons[i].position=DoRotation(DoRotation(DoRotation(weaponpoint,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords+currentoffset*(1-target)*scale+targetoffset*target*scale; weapons[i].bigrotation=rotation; weapons[i].bigtilt=tilt; weapons[i].bigtilt2=tilt2; } weapons[i].rotation1=skeleton.muscles[weaponrotatemuscle].lastrotate1; weapons[i].rotation2=skeleton.muscles[weaponrotatemuscle].lastrotate2; weapons[i].rotation3=skeleton.muscles[weaponrotatemuscle].lastrotate3; if(weaponactive==k){ if(weapons[i].getType()==knife){ weapons[i].smallrotation=180; weapons[i].smallrotation2=0; if(isCrouch()||wasCrouch()){ weapons[i].smallrotation2=20; } if(targetanimation==hurtidleanim){ weapons[i].smallrotation2=50; } if((currentanimation==crouchstabanim&&targetanimation==crouchstabanim)||(currentanimation==backhandspringanim&&targetanimation==backhandspringanim)){ XYZ temppoint1,temppoint2,tempforward; float distance; temppoint1=skeleton.joints[skeleton.jointlabels[righthand]].position; temppoint2=animation[currentanimation].weapontarget[currentframe]*(1-target)+animation[targetanimation].weapontarget[targetframe]*(target); distance=findDistance(&temppoint1,&temppoint2); weapons[i].rotation2=asin((temppoint1.y-temppoint2.y)/distance); weapons[i].rotation2*=360/6.28; temppoint1.y=0; temppoint2.y=0; weapons[i].rotation1=acos((temppoint1.z-temppoint2.z)/findDistance(&temppoint1,&temppoint2)); weapons[i].rotation1*=360/6.28; weapons[i].rotation3=0; weapons[i].smallrotation=-90; weapons[i].smallrotation2=0; if(temppoint1.x>temppoint2.x)weapons[i].rotation1=360-weapons[i].rotation1; } if((currentanimation==knifeslashreversalanim&&targetanimation==knifeslashreversalanim)||(currentanimation==knifeslashreversedanim&&targetanimation==knifeslashreversedanim)){ XYZ temppoint1,temppoint2,tempforward; float distance; temppoint1=skeleton.joints[skeleton.jointlabels[righthand]].position; temppoint2=animation[currentanimation].weapontarget[currentframe]*(1-target)+animation[targetanimation].weapontarget[targetframe]*(target); distance=findDistance(&temppoint1,&temppoint2); weapons[i].rotation2=asin((temppoint1.y-temppoint2.y)/distance); weapons[i].rotation2*=360/6.28; temppoint1.y=0; temppoint2.y=0; weapons[i].rotation1=acos((temppoint1.z-temppoint2.z)/findDistance(&temppoint1,&temppoint2)); weapons[i].rotation1*=360/6.28; weapons[i].rotation3=0; weapons[i].smallrotation=90; weapons[i].smallrotation2=0; if(temppoint1.x>temppoint2.x)weapons[i].rotation1=360-weapons[i].rotation1; } if(targetanimation==knifethrowanim){ weapons[i].smallrotation=90; //weapons[i].smallrotation2=-90; weapons[i].smallrotation2=0; weapons[i].rotation1=0; weapons[i].rotation2=0; weapons[i].rotation3=0; } if(targetanimation==knifesneakattackanim&&targetframe<5){ weapons[i].smallrotation=-90; weapons[i].rotation1=0; weapons[i].rotation2=0; weapons[i].rotation3=0; } } if(weapons[i].getType()==sword){ weapons[i].smallrotation=0; weapons[i].smallrotation2=0; if(targetanimation==knifethrowanim){ weapons[i].smallrotation=-90; weapons[i].smallrotation2=0; weapons[i].rotation1=0; weapons[i].rotation2=0; weapons[i].rotation3=0; } if((targetanimation==swordgroundstabanim&¤tanimation==swordgroundstabanim)||(targetanimation==swordsneakattackanim&¤tanimation==swordsneakattackanim)||(targetanimation==swordslashparryanim&¤tanimation==swordslashparryanim)||(targetanimation==swordslashparriedanim&¤tanimation==swordslashparriedanim)||(targetanimation==swordslashreversalanim&¤tanimation==swordslashreversalanim)||(targetanimation==swordslashreversedanim&¤tanimation==swordslashreversedanim)||(targetanimation==knifeslashreversalanim&¤tanimation==knifeslashreversalanim)||(targetanimation==knifeslashreversedanim&¤tanimation==knifeslashreversedanim)||(targetanimation==swordslashanim&¤tanimation==swordslashanim)||(targetanimation==drawleftanim&¤tanimation==drawleftanim)||(currentanimation==backhandspringanim&&targetanimation==backhandspringanim)){ XYZ temppoint1,temppoint2,tempforward; float distance; temppoint1=animation[currentanimation].position[skeleton.jointlabels[righthand]][currentframe]*(1-target)+animation[targetanimation].position[skeleton.jointlabels[righthand]][targetframe]*(target); //skeleton.joints[skeleton.jointlabels[righthand]].position; temppoint2=animation[currentanimation].weapontarget[currentframe]*(1-target)+animation[targetanimation].weapontarget[targetframe]*(target); distance=findDistance(&temppoint1,&temppoint2); weapons[i].rotation2=asin((temppoint1.y-temppoint2.y)/distance); weapons[i].rotation2*=360/6.28; temppoint1.y=0; temppoint2.y=0; weapons[i].rotation1=acos((temppoint1.z-temppoint2.z)/findDistance(&temppoint1,&temppoint2)); weapons[i].rotation1*=360/6.28; weapons[i].rotation3=0; weapons[i].smallrotation=90; weapons[i].smallrotation2=0; if(temppoint1.x>temppoint2.x)weapons[i].rotation1=360-weapons[i].rotation1; } } if(weapons[i].getType()==staff){ weapons[i].smallrotation=100; weapons[i].smallrotation2=0; if((targetanimation==staffhitanim&¤tanimation==staffhitanim)||(targetanimation==staffhitreversedanim&¤tanimation==staffhitreversedanim)||(targetanimation==staffspinhitreversedanim&¤tanimation==staffspinhitreversedanim)||(targetanimation==staffgroundsmashanim&¤tanimation==staffgroundsmashanim)||(targetanimation==staffspinhitanim&¤tanimation==staffspinhitanim)){ XYZ temppoint1,temppoint2,tempforward; float distance; temppoint1=animation[currentanimation].position[skeleton.jointlabels[righthand]][currentframe]*(1-target)+animation[targetanimation].position[skeleton.jointlabels[righthand]][targetframe]*(target); //skeleton.joints[skeleton.jointlabels[righthand]].position; temppoint2=animation[currentanimation].weapontarget[currentframe]*(1-target)+animation[targetanimation].weapontarget[targetframe]*(target); distance=findDistance(&temppoint1,&temppoint2); weapons[i].rotation2=asin((temppoint1.y-temppoint2.y)/distance); weapons[i].rotation2*=360/6.28; temppoint1.y=0; temppoint2.y=0; weapons[i].rotation1=acos((temppoint1.z-temppoint2.z)/findDistance(&temppoint1,&temppoint2)); weapons[i].rotation1*=360/6.28; weapons[i].rotation3=0; weapons[i].smallrotation=90; weapons[i].smallrotation2=0; if(temppoint1.x>temppoint2.x)weapons[i].rotation1=360-weapons[i].rotation1; } } } if(weaponactive!=k&&weaponstuck!=k){ if(weapons[i].getType()==knife){ weapons[i].smallrotation=-70; weapons[i].smallrotation2=10; } if(weapons[i].getType()==sword){ weapons[i].smallrotation=-100; weapons[i].smallrotation2=-8; } if(weapons[i].getType()==staff){ weapons[i].smallrotation=-100; weapons[i].smallrotation2=-8; } } if(weaponstuck==k){ if(weaponstuckwhere==0) weapons[i].smallrotation=180; else weapons[i].smallrotation=0; weapons[i].smallrotation2=10; } } } } calcrot=0; if(skeleton.free)calcrot=1; if(animation[targetanimation].attack||isRun()||targetanimation==staggerbackhardanim||isFlip()||targetanimation==climbanim||targetanimation==sneakanim||targetanimation==rollanim||targetanimation==walkanim||targetanimation==backhandspringanim||isFlip()||isWallJump())calcrot=1; if(currentanimation!=targetanimation)calcrot=1; //if(id==0)calcrot=1; if(skeleton.free==2)calcrot=0; return 0; } int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model) { static int i,j; static float distance; static float olddistance; static int intersecting; static int firstintersecting; static XYZ point; static XYZ oldp1; static XYZ start,end; static float slopethreshold=-.4; firstintersecting=-1; oldp1=*p1; *p1=*p1-*move; if(findDistancefast(p1,&model->boundingspherecenter)>radius*radius+model->boundingsphereradius*model->boundingsphereradius)return -1; if(*rotate)*p1=DoRotation(*p1,0,-*rotate,0); for(i=0;i<4;i++){ for (j=0;jTriangleNum;j++){ if(model->facenormals[j].y<=slopethreshold){ intersecting=0; distance=abs((model->facenormals[j].x*p1->x)+(model->facenormals[j].y*p1->y)+(model->facenormals[j].z*p1->z)-((model->facenormals[j].x*model->vertex[model->Triangles[j].vertex[0]].x)+(model->facenormals[j].y*model->vertex[model->Triangles[j].vertex[0]].y)+(model->facenormals[j].z*model->vertex[model->Triangles[j].vertex[0]].z))); if(distancefacenormals[j]*distance; if(PointInTriangle( &point, model->facenormals[j], &model->vertex[model->Triangles[j].vertex[0]], &model->vertex[model->Triangles[j].vertex[1]], &model->vertex[model->Triangles[j].vertex[2]]))intersecting=1; if(!intersecting)intersecting=sphere_line_intersection(&model->vertex[model->Triangles[j].vertex[0]], &model->vertex[model->Triangles[j].vertex[1]], p1, &radius); if(!intersecting)intersecting=sphere_line_intersection(&model->vertex[model->Triangles[j].vertex[1]], &model->vertex[model->Triangles[j].vertex[2]], p1, &radius); if(!intersecting)intersecting=sphere_line_intersection(&model->vertex[model->Triangles[j].vertex[0]], &model->vertex[model->Triangles[j].vertex[2]], p1, &radius); end=*p1-point; if(dotproduct(&model->facenormals[j],&end)>0&&intersecting){ start=*p1; end=*p1; end.y-=radius; if(LineFacetd(&start,&end,&model->vertex[model->Triangles[j].vertex[0]],&model->vertex[model->Triangles[j].vertex[1]],&model->vertex[model->Triangles[j].vertex[2]],&model->facenormals[j],&point)){ p1->y=point.y+radius; if((targetanimation==jumpdownanim||isFlip())){ if(isFlip()&&(targetframe<5||animation[targetanimation].label[targetframe]==7||animation[targetanimation].label[targetframe]==4))RagDoll(0); if(targetanimation==jumpupanim){jumppower=-4;targetanimation=getIdle();} target=0; targetframe=0; onterrain=1; if(id==0){ pause_sound(whooshsound); OPENAL_SetVolume(channels[whooshsound], 0); } if((targetanimation==jumpdownanim||isFlip())&&!wasLanding()&&!wasLandhard()){ if(isFlip())jumppower=-4; targetanimation=getLanding(); emit_sound_at(landsound, coords, 128.); if(id==0){ envsound[numenvsounds]=coords; envsoundvol[numenvsounds]=16; envsoundlife[numenvsounds]=.4; numenvsounds++; } } } } } } if((distanceTriangleNum;j++){ if(model->facenormals[j].y>slopethreshold){ intersecting=0; start=*p1; start.y-=radius/4; distance=abs((model->facenormals[j].x*start.x)+(model->facenormals[j].y*start.y)+(model->facenormals[j].z*start.z)-((model->facenormals[j].x*model->vertex[model->Triangles[j].vertex[0]].x)+(model->facenormals[j].y*model->vertex[model->Triangles[j].vertex[0]].y)+(model->facenormals[j].z*model->vertex[model->Triangles[j].vertex[0]].z))); if(distancefacenormals[j]*distance; if(PointInTriangle( &point, model->facenormals[j], &model->vertex[model->Triangles[j].vertex[0]], &model->vertex[model->Triangles[j].vertex[1]], &model->vertex[model->Triangles[j].vertex[2]]))intersecting=1; if(!intersecting)intersecting=sphere_line_intersection(model->vertex[model->Triangles[j].vertex[0]].x,model->vertex[model->Triangles[j].vertex[0]].y,model->vertex[model->Triangles[j].vertex[0]].z, model->vertex[model->Triangles[j].vertex[1]].x,model->vertex[model->Triangles[j].vertex[1]].y,model->vertex[model->Triangles[j].vertex[1]].z, p1->x, p1->y, p1->z, radius/2); if(!intersecting)intersecting=sphere_line_intersection(model->vertex[model->Triangles[j].vertex[1]].x,model->vertex[model->Triangles[j].vertex[1]].y,model->vertex[model->Triangles[j].vertex[1]].z, model->vertex[model->Triangles[j].vertex[2]].x,model->vertex[model->Triangles[j].vertex[2]].y,model->vertex[model->Triangles[j].vertex[2]].z, p1->x, p1->y, p1->z, radius/2); if(!intersecting)intersecting=sphere_line_intersection(model->vertex[model->Triangles[j].vertex[0]].x,model->vertex[model->Triangles[j].vertex[0]].y,model->vertex[model->Triangles[j].vertex[0]].z, model->vertex[model->Triangles[j].vertex[2]].x,model->vertex[model->Triangles[j].vertex[2]].y,model->vertex[model->Triangles[j].vertex[2]].z, p1->x, p1->y, p1->z, radius/2); end=*p1-point; if(dotproduct(&model->facenormals[j],&end)>0&&intersecting){ if((targetanimation==jumpdownanim||targetanimation==jumpupanim||isFlip())){ start=velocity; velocity-=DoRotation(model->facenormals[j],0,*rotate,0)*findLength(&velocity)*abs(normaldotproduct(velocity,DoRotation(model->facenormals[j],0,*rotate,0)));//(distance-radius*.5)/multiplier; if(findLengthfast(&start)facenormals[j]*(distance-radius*.5); } } if((distance #include //keeps track of which textures are loaded class Texture { private: static std::map textures; bool isSkin; std::string fileName; GLuint id; bool mipmap; bool hasalpha; GLubyte* array; int arraySize; int skinsize; void load(); public: Texture(): isSkin(false), skinsize(0), arraySize(0), fileName(""), id(0), mipmap(false), hasalpha(false), array(NULL) { } ~Texture(); Texture (const std::string& _fileName, bool _mipmap, bool _hasalpha): isSkin(false), skinsize(0), arraySize(0), array(NULL), fileName(_fileName), id(0), mipmap(_mipmap), hasalpha(_hasalpha) { } Texture (const std::string& _fileName, bool _mipmap, bool _hasalpha, bool _isSkin): isSkin(_isSkin), skinsize(0), arraySize(0), array(NULL), fileName(_fileName), id(0), mipmap(_mipmap), hasalpha(_hasalpha) { } GLuint getId() const { return id; } static GLuint Load(const std::string& fileName, bool mipmap, bool hasalpha); static GLuint Load(const std::string& fileName, bool mipmap, bool hasalpha, GLubyte* array, int* skinsize); }; lugaru-0~20110520.1+hge4354.orig/Source/Terrain.h0000644000000000000000000001001511571222446017414 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _TERRAIN_H_ #define _TERRAIN_H_ #include "gamegl.h" #include "Frustum.h" #include "Lights.h" #include "TGALoader.h" #include "Quaternions.h" #include "Quaternions.h" #define max_terrain_size 256 #define curr_terrain_size size #define subdivision 64 #define max_patch_elements (max_terrain_size/subdivision)*(max_terrain_size/subdivision)*54 #define allfirst 0 #define mixed 1 #define allsecond 2 #define max_decals 1000 #define shadowdecal 0 #define footprintdecal 1 #define blooddecal 2 #define blooddecalfast 3 #define shadowdecalpermanent 4 #define breakdecal 5 #define blooddecalslow 6 #define bodyprintdecal 7 #define snowyenvironment 0 #define grassyenvironment 1 #define desertenvironment 2 // // Model Structures // class Terrain{ public: GLuint bloodtexture; GLuint bloodtexture2; GLuint shadowtexture; GLuint footprinttexture; GLuint bodyprinttexture; GLuint breaktexture; GLuint terraintexture; short size; int patchobjectnum[subdivision][subdivision]; int patchobjects[subdivision][subdivision][300]; float scale; int type; float heightmap[max_terrain_size+1][max_terrain_size+1]; XYZ normals[max_terrain_size][max_terrain_size]; XYZ facenormals[max_terrain_size][max_terrain_size]; XYZ triangles[(max_terrain_size-1)*(max_terrain_size-1)*2][3]; float colors[max_terrain_size][max_terrain_size][4]; float opacityother[max_terrain_size][max_terrain_size]; float texoffsetx[max_terrain_size][max_terrain_size]; float texoffsety[max_terrain_size][max_terrain_size]; int numtris[subdivision][subdivision]; int textureness[subdivision][subdivision]; GLfloat vArray[(max_patch_elements)*subdivision*subdivision]; bool visible[subdivision][subdivision]; float avgypatch[subdivision][subdivision]; float maxypatch[subdivision][subdivision]; float minypatch[subdivision][subdivision]; float heightypatch[subdivision][subdivision]; int patch_elements; float decaltexcoords[max_decals][3][2]; XYZ decalvertex[max_decals][3]; int decaltype[max_decals]; float decalopacity[max_decals]; float decalrotation[max_decals]; float decalalivetime[max_decals]; float decalbrightness[max_decals]; XYZ decalposition[max_decals]; int numdecals; void AddObject(XYZ where, float radius,int id); void DeleteDecal(int which); void MakeDecal(int type, XYZ where, float size, float opacity, float rotation); void MakeDecalLock(int type, XYZ where, int whichx, int whichy, float size, float opacity, float rotation); int lineTerrain(XYZ p1,XYZ p2, XYZ *p); float getHeight(float pointx, float pointz); float getHeightExtrude(float pointx, float pointz,float point2x, float point2z); float getOpacity(float pointx, float pointz); XYZ getLighting(float pointx, float pointz); XYZ getNormal(float pointx, float pointz); void UpdateVertexArray(int whichx, int whichy); void UpdateTransparency(int whichx, int whichy); void UpdateTransparencyother(int whichx, int whichy); void UpdateTransparencyotherother(int whichx, int whichy); bool load(const char *fileName); void CalculateNormals(); void drawdecals(); void draw(int layer); void drawpatch(int whichx, int whichy, float opacity); void drawpatchother(int whichx, int whichy, float opacity); void drawpatchotherother(int whichx, int whichy, float opacity); void DoLighting(); void DoShadows(); Terrain(); ~Terrain(); }; #endif lugaru-0~20110520.1+hge4354.orig/Source/Skeleton.h0000644000000000000000000001054511571222446017604 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SKELETON_H_ #define _SKELETON_H_ #include "Models.h" #include "Quaternions.h" /**> HEADER FILES <**/ #include "gamegl.h" #include "Quaternions.h" #include "Objects.h" #include "Sprite.h" #include "binio.h" enum bodyparts { head, neck, leftshoulder, leftelbow, leftwrist, lefthand, rightshoulder, rightelbow, rightwrist, righthand, abdomen, lefthip, righthip, groin, leftknee, leftankle, leftfoot, rightknee, rightankle, rightfoot }; class Joint { public: XYZ position; XYZ oldposition; XYZ realoldposition; XYZ velocity; XYZ oldvelocity; XYZ startpos; float blurred; float length; float mass; bool lower; bool hasparent; bool locked; int modelnum; bool visible; Joint* parent; bool sametwist; int label; int hasgun; float delay; XYZ velchange; Joint() { blurred = 0; length = 0; mass = 0; lower = 0; hasparent = 0; locked = 0; modelnum = 0; visible = 0; parent = 0; sametwist = 0; label = 0; hasgun = 0; delay = 0; } void DoConstraint(); }; class Muscle { public: int numvertices; int* vertices; int numverticeslow; int* verticeslow; int numverticesclothes; int* verticesclothes; float length; float targetlength; Joint* parent1; Joint* parent2; float maxlength; float minlength; int type; bool visible; void DoConstraint(bool spinny); float rotate1,rotate2,rotate3; float lastrotate1,lastrotate2,lastrotate3; float oldrotate1,oldrotate2,oldrotate3; float newrotate1,newrotate2,newrotate3; float strength; ~Muscle(); Muscle(); }; class Animation { public: int numframes; int height; int attack; int joints; int weapontargetnum; XYZ** position; float** twist; float** twist2; float* speed; bool** onground; XYZ* forward; int* label; XYZ* weapontarget; XYZ offset; Animation(); ~Animation(); Animation & operator = (const Animation & ani); void Load(const char *fileName, int aheight, int aattack); void Move(XYZ how); protected: void deallocate(); }; const int max_joints = 50; class Skeleton { public: int num_joints; //Joint joints[max_joints]; //Joint *joints; Joint* joints; int num_muscles; //Muscle muscles[max_muscles]; //Muscle *muscles; Muscle* muscles; int selected; int forwardjoints[3]; XYZ forward; int id; int lowforwardjoints[3]; XYZ lowforward; XYZ specialforward[5]; int jointlabels[max_joints]; Model model[7]; Model modellow; Model modelclothes; int num_models; Model drawmodel; Model drawmodellow; Model drawmodelclothes; bool clothes; bool spinny; GLubyte skinText[512*512*3]; int skinsize; float checkdelay; float longdead; bool broken; int free; int oldfree; float freetime; bool freefall; void FindForwards(); void FindForwardsfirst(); float DoConstraints(XYZ *coords,float *scale); void DoGravity(float *scale); void DoBalance(); void MusclesSet(); void Draw(int muscleview); void AddJoint(float x, float y, float z, int which); void SetJoint(float x, float y, float z, int which, int whichjoint); void DeleteJoint(int whichjoint); void AddMuscle(int attach1,int attach2,float maxlength,float minlength,int type); void DeleteMuscle(int whichmuscle); void FindRotationJoint(int which); void FindRotationJointSameTwist(int which); void FindRotationMuscle(int which, int animation); void Load(const char *fileName,const char *lowfileName,const char *clothesfileName,const char *modelfileName,const char *model2fileName,const char *model3fileName,const char *model4fileName,const char *model5fileNamee,const char *model6fileName,const char *model7fileName,const char *modellowfileName,const char *modelclothesfileName, bool aclothes); Skeleton(); ~Skeleton(); }; #endif lugaru-0~20110520.1+hge4354.orig/Source/private.h0000644000000000000000000001100211571222446017457 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef private_h #define private_h #include #include #define BinIO_TYPE_IGNORE_BYTE 'x' #define BinIO_TYPE_BYTE 'b' #define BinIO_TYPE_INT16 's' #define BinIO_TYPE_INT32 'i' #define BinIO_TYPE_INT64 'l' #define BinIO_TYPE_FLOAT32 'f' #define BinIO_TYPE_FLOAT64 'd' #define BinIO_LITTLE_ENDIAN_BYTE_ORDER 'L' #define BinIO_BIG_ENDIAN_BYTE_ORDER 'B' #define BinIO_HOST_BYTE_ORDER 'H' #define BinIO_NETWORK_BYTE_ORDER 'N' #ifndef ALREADY_DID_BINIO_STDINT #define ALREADY_DID_BINIO_STDINT #if defined(BinIO_STDINT_HEADER) #include BinIO_STDINT_HEADER typedef float float32_t; typedef double float64_t; #else typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifdef WIN32 typedef unsigned __int64 uint64_t; #else typedef unsigned long long uint64_t; #endif typedef float float32_t; typedef double float64_t; #endif #endif #ifndef BinIO_INLINE #if defined(__GNUC__) #define BinIO_INLINE static inline #else #define BinIO_INLINE static #endif #endif #ifndef BinIO_BYTE_ORDER #if defined(__ppc__) || defined(__POWERPC__) #define BinIO_BYTE_ORDER BinIO_BIG_ENDIAN_BYTE_ORDER #else #define BinIO_BYTE_ORDER BinIO_LITTLE_ENDIAN_BYTE_ORDER #endif #endif BinIO_INLINE void BinIOSwap1(const uint8_t *src, uint8_t *dst) { *dst = *src; } BinIO_INLINE void BinIOSwap2(const uint8_t *src, uint8_t *dst) { *(dst + 1) = *(src + 0); *(dst + 0) = *(src + 1); } BinIO_INLINE void BinIOSwap4(const uint8_t *src, uint8_t *dst) { *(dst + 3) = *(src + 0); *(dst + 2) = *(src + 1); *(dst + 1) = *(src + 2); *(dst + 0) = *(src + 3); } BinIO_INLINE void BinIOSwap8(const uint8_t *src, uint8_t *dst) { *(dst + 7) = *(src + 0); *(dst + 6) = *(src + 1); *(dst + 5) = *(src + 2); *(dst + 4) = *(src + 3); *(dst + 3) = *(src + 4); *(dst + 2) = *(src + 5); *(dst + 1) = *(src + 6); *(dst + 0) = *(src + 7); } BinIO_INLINE int BinIONormalizeByteOrder(int byte_order) { if (byte_order == BinIO_HOST_BYTE_ORDER) { byte_order = BinIO_BYTE_ORDER; } else if (byte_order == BinIO_NETWORK_BYTE_ORDER) { byte_order = BinIO_BIG_ENDIAN_BYTE_ORDER; } return byte_order; } extern void BinIOConvert1(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count); extern void BinIOConvert2(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count); extern void BinIOConvert4(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count); extern void BinIOConvert8(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count); struct BinIOFormatCursor { const char *cursor; int byte_order; int count; }; typedef void (*BinIOProcessFunction)(void *context, int type, int byte_order, int count); extern void BinIOInitFormatCursor(struct BinIOFormatCursor *cursor, const char *format); extern int BinIONextChar(void *context, struct BinIOFormatCursor *cursor, BinIOProcessFunction func); extern void BinIOCountBytes(void *context, int type, int byte_order, int count); extern size_t BinIOFormatByteCount(const char *format); #endif lugaru-0~20110520.1+hge4354.orig/Source/Quaternions.h0000644000000000000000000003074311571222446020332 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _QUATERNIONS_H_ #define _QUATERNIONS_H_ #ifndef WIN32 #pragma mark - #endif //#include "Carbon.h" #include "math.h" #include "PhysicsMath.h" #include "gamegl.h" /**> Quaternion Structures <**/ #define PI 3.14159265355555897932384626 #define RADIANS 0 #define DEGREES 1 #define deg2rad .0174532925 //using namespace std; typedef float Matrix_t [4][4]; struct euler { float x, y, z; }; struct angle_axis { float x, y, z, angle; }; struct quaternion { float x, y, z, w; }; class XYZ{ public: float x; float y; float z; XYZ() : x(0.0f), y(0.0f), z(0.0f) {} inline XYZ operator+(XYZ add); inline XYZ operator-(XYZ add); inline XYZ operator*(float add); inline XYZ operator*(XYZ add); inline XYZ operator/(float add); inline void operator+=(XYZ add); inline void operator-=(XYZ add); inline void operator*=(float add); inline void operator*=(XYZ add); inline void operator/=(float add); inline void operator=(float add); inline void vec(Vector add); inline bool operator==(XYZ add); }; /*********************> Quaternion Function definition <********/ quaternion To_Quat(int Degree_Flag, euler Euler); quaternion To_Quat(angle_axis Ang_Ax); quaternion To_Quat(Matrix_t m); angle_axis Quat_2_AA(quaternion Quat); void Quat_2_Matrix(quaternion Quat, Matrix_t m); quaternion Normalize(quaternion Quat); quaternion Quat_Mult(quaternion q1, quaternion q2); quaternion QNormalize(quaternion Quat); XYZ Quat2Vector(quaternion Quat); inline void CrossProduct(XYZ *P, XYZ *Q, XYZ *V); inline void CrossProduct(XYZ P, XYZ Q, XYZ *V); inline void Normalise(XYZ *vectory); inline float normaldotproduct(XYZ point1, XYZ point2); inline float fast_sqrt (register float arg); bool PointInTriangle(XYZ *p, XYZ normal, XYZ *p1, XYZ *p2, XYZ *p3); bool LineFacet(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p); float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p); float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ n, XYZ *p); float LineFacetd(XYZ *p1,XYZ *p2,XYZ *pa,XYZ *pb,XYZ *pc,XYZ *n, XYZ *p); float LineFacetd(XYZ *p1,XYZ *p2,XYZ *pa,XYZ *pb,XYZ *pc, XYZ *p); bool PointInTriangle(Vector *p, Vector normal, float p11, float p12, float p13, float p21, float p22, float p23, float p31, float p32, float p33); bool LineFacet(Vector p1,Vector p2,Vector pa,Vector pb,Vector pc,Vector *p); inline void ReflectVector(XYZ *vel, const XYZ *n); inline void ReflectVector(XYZ *vel, const XYZ &n); inline XYZ DoRotation(XYZ thePoint, float xang, float yang, float zang); inline XYZ DoRotationRadian(XYZ thePoint, float xang, float yang, float zang); inline float findDistance(XYZ *point1, XYZ *point2); inline float findLength(XYZ *point1); inline float findLengthfast(XYZ *point1); inline float findDistancefast(XYZ *point1, XYZ *point2); inline float findDistancefast(XYZ point1, XYZ point2); inline float findDistancefastflat(XYZ *point1, XYZ *point2); inline float dotproduct(const XYZ *point1, const XYZ *point2); bool sphere_line_intersection ( float x1, float y1 , float z1, float x2, float y2 , float z2, float x3, float y3 , float z3, float r ); bool sphere_line_intersection ( XYZ *p1, XYZ *p2, XYZ *p3, float *r ); inline bool DistancePointLine( XYZ *Point, XYZ *LineStart, XYZ *LineEnd, float *Distance, XYZ *Intersection ); inline void Normalise(XYZ *vectory) { static float d; d = fast_sqrt(vectory->x*vectory->x+vectory->y*vectory->y+vectory->z*vectory->z); if(d==0){return;} vectory->x /= d; vectory->y /= d; vectory->z /= d; } inline XYZ XYZ::operator+(XYZ add){ static XYZ ne; ne=add; ne.x+=x; ne.y+=y; ne.z+=z; return ne; } inline XYZ XYZ::operator-(XYZ add){ static XYZ ne; ne=add; ne.x=x-ne.x; ne.y=y-ne.y; ne.z=z-ne.z; return ne; } inline XYZ XYZ::operator*(float add){ static XYZ ne; ne.x=x*add; ne.y=y*add; ne.z=z*add; return ne; } inline XYZ XYZ::operator*(XYZ add){ static XYZ ne; ne.x=x*add.x; ne.y=y*add.y; ne.z=z*add.z; return ne; } inline XYZ XYZ::operator/(float add){ static XYZ ne; ne.x=x/add; ne.y=y/add; ne.z=z/add; return ne; } inline void XYZ::operator+=(XYZ add){ x+=add.x; y+=add.y; z+=add.z; } inline void XYZ::operator-=(XYZ add){ x=x-add.x; y=y-add.y; z=z-add.z; } inline void XYZ::operator*=(float add){ x=x*add; y=y*add; z=z*add; } inline void XYZ::operator*=(XYZ add){ x=x*add.x; y=y*add.y; z=z*add.z; } inline void XYZ::operator/=(float add){ x=x/add; y=y/add; z=z/add; } inline void XYZ::operator=(float add){ x=add; y=add; z=add; } inline void XYZ::vec(Vector add){ x=add.x; y=add.y; z=add.z; } inline bool XYZ::operator==(XYZ add){ if(x==add.x&&y==add.y&&z==add.z)return 1; return 0; } inline void CrossProduct(XYZ *P, XYZ *Q, XYZ *V){ V->x = P->y * Q->z - P->z * Q->y; V->y = P->z * Q->x - P->x * Q->z; V->z = P->x * Q->y - P->y * Q->x; } inline void CrossProduct(XYZ P, XYZ Q, XYZ *V){ V->x = P.y * Q.z - P.z * Q.y; V->y = P.z * Q.x - P.x * Q.z; V->z = P.x * Q.y - P.y * Q.x; } inline float fast_sqrt (register float arg) { #if PLATFORM_MACOSX // Can replace with slower return std::sqrt(arg); register float result; if (arg == 0.0) return 0.0; asm { frsqrte result,arg // Calculate Square root } // Newton Rhapson iterations. result = result + 0.5 * result * (1.0 - arg * result * result); result = result + 0.5 * result * (1.0 - arg * result * result); return result * arg; #else return sqrtf( arg); #endif } inline float normaldotproduct(XYZ point1, XYZ point2){ static GLfloat returnvalue; Normalise(&point1); Normalise(&point2); returnvalue=(point1.x*point2.x+point1.y*point2.y+point1.z*point2.z); return returnvalue; } inline void ReflectVector(XYZ *vel, const XYZ *n) { ReflectVector(vel, *n); } inline void ReflectVector(XYZ *vel, const XYZ &n) { static XYZ vn; static XYZ vt; static float dotprod; dotprod=dotproduct(&n,vel); vn.x=n.x*dotprod; vn.y=n.y*dotprod; vn.z=n.z*dotprod; vt.x=vel->x-vn.x; vt.y=vel->y-vn.y; vt.z=vel->z-vn.z; vel->x = vt.x - vn.x; vel->y = vt.y - vn.y; vel->z = vt.z - vn.z; } inline float dotproduct(const XYZ *point1, const XYZ *point2){ static GLfloat returnvalue; returnvalue=(point1->x*point2->x+point1->y*point2->y+point1->z*point2->z); return returnvalue; } inline float findDistance(XYZ *point1, XYZ *point2){ return(fast_sqrt((point1->x-point2->x)*(point1->x-point2->x)+(point1->y-point2->y)*(point1->y-point2->y)+(point1->z-point2->z)*(point1->z-point2->z))); } inline float findLength(XYZ *point1){ return(fast_sqrt((point1->x)*(point1->x)+(point1->y)*(point1->y)+(point1->z)*(point1->z))); } inline float findLengthfast(XYZ *point1){ return((point1->x)*(point1->x)+(point1->y)*(point1->y)+(point1->z)*(point1->z)); } inline float findDistancefast(XYZ *point1, XYZ *point2){ return((point1->x-point2->x)*(point1->x-point2->x)+(point1->y-point2->y)*(point1->y-point2->y)+(point1->z-point2->z)*(point1->z-point2->z)); } inline float findDistancefast(XYZ point1, XYZ point2){ return((point1.x-point2.x)*(point1.x-point2.x)+(point1.y-point2.y)*(point1.y-point2.y)+(point1.z-point2.z)*(point1.z-point2.z)); } inline float findDistancefastflat(XYZ *point1, XYZ *point2){ return((point1->x-point2->x)*(point1->x-point2->x)+(point1->z-point2->z)*(point1->z-point2->z)); } inline XYZ DoRotation(XYZ thePoint, float xang, float yang, float zang){ static XYZ newpoint; if(xang){ xang*=6.283185f; xang/=360; } if(yang){ yang*=6.283185f; yang/=360; } if(zang){ zang*=6.283185f; zang/=360; } if(yang){ newpoint.z=thePoint.z*cosf(yang)-thePoint.x*sinf(yang); newpoint.x=thePoint.z*sinf(yang)+thePoint.x*cosf(yang); thePoint.z=newpoint.z; thePoint.x=newpoint.x; } if(zang){ newpoint.x=thePoint.x*cosf(zang)-thePoint.y*sinf(zang); newpoint.y=thePoint.y*cosf(zang)+thePoint.x*sinf(zang); thePoint.x=newpoint.x; thePoint.y=newpoint.y; } if(xang){ newpoint.y=thePoint.y*cosf(xang)-thePoint.z*sinf(xang); newpoint.z=thePoint.y*sinf(xang)+thePoint.z*cosf(xang); thePoint.z=newpoint.z; thePoint.y=newpoint.y; } return thePoint; } inline float square( float f ) { return (f*f) ;} inline bool sphere_line_intersection ( float x1, float y1 , float z1, float x2, float y2 , float z2, float x3, float y3 , float z3, float r ) { // x1,y1,z1 P1 coordinates (point of line) // x2,y2,z2 P2 coordinates (point of line) // x3,y3,z3, r P3 coordinates and radius (sphere) // x,y,z intersection coordinates // // This function returns a pointer array which first index indicates // the number of intersection point, followed by coordinate pairs. //~ static float x , y , z; static float a, b, c, /*mu,*/ i ; if(x1>x3+r&&x2>x3+r)return(0); if(x1y3+r&&y2>y3+r)return(0); if(y1z3+r&&z2>z3+r)return(0); if(z1y,p1->z P1 coordinates (point of line) // p2->x,p2->y,p2->z P2 coordinates (point of line) // p3->x,p3->y,p3->z, r P3 coordinates and radius (sphere) // x,y,z intersection coordinates // // This function returns a pointer array which first index indicates // the number of intersection point, followed by coordinate pairs. //~ static float x , y , z; static float a, b, c, /*mu,*/ i ; if(p1->x>p3->x+*r&&p2->x>p3->x+*r)return(0); if(p1->xx-*r&&p2->xx-*r)return(0); if(p1->y>p3->y+*r&&p2->y>p3->y+*r)return(0); if(p1->yy-*r&&p2->yy-*r)return(0); if(p1->z>p3->z+*r&&p2->z>p3->z+*r)return(0); if(p1->zz-*r&&p2->zz-*r)return(0); a = square(p2->x - p1->x) + square(p2->y - p1->y) + square(p2->z - p1->z); b = 2* ( (p2->x - p1->x)*(p1->x - p3->x) + (p2->y - p1->y)*(p1->y - p3->y) + (p2->z - p1->z)*(p1->z - p3->z) ) ; c = square(p3->x) + square(p3->y) + square(p3->z) + square(p1->x) + square(p1->y) + square(p1->z) - 2* ( p3->x*p1->x + p3->y*p1->y + p3->z*p1->z ) - square(*r) ; i = b * b - 4 * a * c ; if ( i < 0.0 ) { // no intersection return(0); } return(1); } inline XYZ DoRotationRadian(XYZ thePoint, float xang, float yang, float zang){ static XYZ newpoint; static XYZ oldpoint; oldpoint=thePoint; if(yang!=0){ newpoint.z=oldpoint.z*cosf(yang)-oldpoint.x*sinf(yang); newpoint.x=oldpoint.z*sinf(yang)+oldpoint.x*cosf(yang); oldpoint.z=newpoint.z; oldpoint.x=newpoint.x; } if(zang!=0){ newpoint.x=oldpoint.x*cosf(zang)-oldpoint.y*sinf(zang); newpoint.y=oldpoint.y*cosf(zang)+oldpoint.x*sinf(zang); oldpoint.x=newpoint.x; oldpoint.y=newpoint.y; } if(xang!=0){ newpoint.y=oldpoint.y*cosf(xang)-oldpoint.z*sinf(xang); newpoint.z=oldpoint.y*sinf(xang)+oldpoint.z*cosf(xang); oldpoint.z=newpoint.z; oldpoint.y=newpoint.y; } return oldpoint; } inline bool DistancePointLine( XYZ *Point, XYZ *LineStart, XYZ *LineEnd, float *Distance, XYZ *Intersection ) { float LineMag; float U; LineMag = findDistance( LineEnd, LineStart ); U = ( ( ( Point->x - LineStart->x ) * ( LineEnd->x - LineStart->x ) ) + ( ( Point->y - LineStart->y ) * ( LineEnd->y - LineStart->y ) ) + ( ( Point->z - LineStart->z ) * ( LineEnd->z - LineStart->z ) ) ) / ( LineMag * LineMag ); if( U < 0.0f || U > 1.0f ) return 0; // closest point does not fall within the line segment Intersection->x = LineStart->x + U * ( LineEnd->x - LineStart->x ); Intersection->y = LineStart->y + U * ( LineEnd->y - LineStart->y ); Intersection->z = LineStart->z + U * ( LineEnd->z - LineStart->z ); *Distance = findDistance( Point, Intersection ); return 1; } #endif lugaru-0~20110520.1+hge4354.orig/Source/Models.cpp0000644000000000000000000014210211571222446017571 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Game.h" #include "Models.h" extern float multiplier; extern float viewdistance; extern XYZ viewer; extern float fadestart; extern float texdetail; extern bool decals; extern Game * pgame; extern bool visibleloading; int Model::LineCheck(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate) { static int j; static float distance; static float olddistance; static int intersecting; static int firstintersecting; static XYZ point; *p1=*p1-*move; *p2=*p2-*move; if(*rotate)*p1=DoRotation(*p1,0,-*rotate,0); if(*rotate)*p2=DoRotation(*p2,0,-*rotate,0); if(!sphere_line_intersection(p1,p2,&boundingspherecenter, &boundingsphereradius))return -1; firstintersecting=-1; for (j=0;jx)*(point.x-p1->x)+(point.y-p1->y)*(point.y-p1->y)+(point.z-p1->z)*(point.z-p1->z); if((distancex)*(point.x-p1->x)+(point.y-p1->y)*(point.y-p1->y)+(point.z-p1->z)*(point.z-p1->z); if((distancex)+(facenormals[firstintersecting].y*p2->y)+(facenormals[firstintersecting].z*p2->z)-((facenormals[firstintersecting].x*vertex[Triangles[firstintersecting].vertex[0]].x)+(facenormals[firstintersecting].y*vertex[Triangles[firstintersecting].vertex[0]].y)+(facenormals[firstintersecting].z*vertex[Triangles[firstintersecting].vertex[0]].z))); *p2-=facenormals[firstintersecting]*distance; if(*rotate)*p2=DoRotation(*p2,0,*rotate,0); *p2=*p2+*move; return firstintersecting; } int Model::LineCheckPossible(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate) { static int j; static float distance; static float olddistance; static int intersecting; static int firstintersecting; static XYZ point; *p1=*p1-*move; *p2=*p2-*move; if(!sphere_line_intersection(p1,p2,&boundingspherecenter, &boundingsphereradius))return -1; firstintersecting=-1; if(*rotate)*p1=DoRotation(*p1,0,-*rotate,0); if(*rotate)*p2=DoRotation(*p2,0,-*rotate,0); if(numpossible>0&&numpossible=0&&possible[j]x)*(point.x-p1->x)+(point.y-p1->y)*(point.y-p1->y)+(point.z-p1->z)*(point.z-p1->z); if((distance=0&&possible[j]x)*(point.x-p1->x)+(point.y-p1->y)*(point.y-p1->y)+(point.z-p1->z)*(point.z-p1->z); if((distance0){ distance=abs((facenormals[firstintersecting].x*p2->x)+(facenormals[firstintersecting].y*p2->y)+(facenormals[firstintersecting].z*p2->z)-((facenormals[firstintersecting].x*vertex[Triangles[firstintersecting].vertex[0]].x)+(facenormals[firstintersecting].y*vertex[Triangles[firstintersecting].vertex[0]].y)+(facenormals[firstintersecting].z*vertex[Triangles[firstintersecting].vertex[0]].z))); *p2-=facenormals[firstintersecting]*distance; } if(*rotate)*p2=DoRotation(*p2,0,*rotate,0); *p2=*p2+*move; return firstintersecting; } int Model::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate) { static int i,j; static float distance; static float olddistance; static int intersecting; static int firstintersecting; static XYZ point; static XYZ oldp1; static XYZ start,end; firstintersecting=-1; oldp1=*p1; *p1=*p1-*move; if(*rotate)*p1=DoRotation(*p1,0,-*rotate,0); if(findDistancefast(p1,&boundingspherecenter)>radius*radius+boundingsphereradius*boundingsphereradius)return -1; for(i=0;i<4;i++){ for (j=0;jx)+(facenormals[j].y*p1->y)+(facenormals[j].z*p1->z)-((facenormals[j].x*vertex[Triangles[j].vertex[0]].x)+(facenormals[j].y*vertex[Triangles[j].vertex[0]].y)+(facenormals[j].z*vertex[Triangles[j].vertex[0]].z))); if(distancey=point.y+radius; }*/ } } if((distanceradius*radius+boundingsphereradius*boundingsphereradius){*p1=oldp1; return -1;} for (j=0;jx)+(facenormals[j].y*p1->y)+(facenormals[j].z*p1->z)-((facenormals[j].x*vertex[Triangles[j].vertex[0]].x)+(facenormals[j].y*vertex[Triangles[j].vertex[0]].y)+(facenormals[j].z*vertex[Triangles[j].vertex[0]].z))); if(distance=0&&jboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); return 1; } bool Model::load(const char *filename,bool texture ) { FILE *tfile; long i; LOGFUNC; LOG(std::string("Loading model...") + filename); if(visibleloading) pgame->LoadingScreen(); int oldvertexNum,oldTriangleNum; oldvertexNum=vertexNum; oldTriangleNum=TriangleNum; type = normaltype; color=0; tfile=fopen( ConvertFileName(filename), "rb" ); // read model settings fseek(tfile, 0, SEEK_SET); funpackf(tfile, "Bs Bs", &vertexNum, &TriangleNum); // read the model data deallocate(); numpossible=0; owner = (int*)malloc(sizeof(int)*vertexNum); possible = (int*)malloc(sizeof(int)*TriangleNum); vertex = (XYZ*)malloc(sizeof(XYZ)*vertexNum); normals = (XYZ*)malloc(sizeof(XYZ)*vertexNum); facenormals = (XYZ*)malloc(sizeof(XYZ)*TriangleNum); Triangles = (TexturedTriangle*)malloc(sizeof(TexturedTriangle)*TriangleNum); vArray = (GLfloat*)malloc(sizeof(GLfloat)*TriangleNum*24); for(i=0;iboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); return 1; } bool Model::loaddecal(const char *filename,bool texture ) { FILE *tfile; long i,j; LOGFUNC; // Changing the filename so that its more os specific char * FixedFN = ConvertFileName(filename); LOG(std::string("Loading decal...") + FixedFN); int oldvertexNum,oldTriangleNum; oldvertexNum=vertexNum; oldTriangleNum=TriangleNum; type = decalstype; numdecals=0; color=0; tfile=fopen( FixedFN, "rb" ); // read model settings fseek(tfile, 0, SEEK_SET); funpackf(tfile, "Bs Bs", &vertexNum, &TriangleNum); // read the model data deallocate(); numpossible=0; owner = (int*)malloc(sizeof(int)*vertexNum); possible = (int*)malloc(sizeof(int)*TriangleNum); vertex = (XYZ*)malloc(sizeof(XYZ)*vertexNum); normals = (XYZ*)malloc(sizeof(XYZ)*vertexNum); facenormals = (XYZ*)malloc(sizeof(XYZ)*TriangleNum); Triangles = (TexturedTriangle*)malloc(sizeof(TexturedTriangle)*TriangleNum); vArray = (GLfloat*)malloc(sizeof(GLfloat)*TriangleNum*24); for(i=0;iboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); //allow decals if(!decaltexcoords){ decaltexcoords = (float***)malloc(sizeof(float**)*max_model_decals); for(i=0;iboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); } void Model::ScaleNormals(float xscale,float yscale,float zscale) { if(type!=normaltype&&type!=decalstype)return; static int i; for(i=0; iboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); } void Model::Rotate(float xang,float yang,float zang) { static int i; for(i=0; iboundingsphereradius){ boundingsphereradius=findDistancefast(&vertex[j],&vertex[i])/2; boundingspherecenter=(vertex[i]+vertex[j])/2; } } } boundingsphereradius=fast_sqrt(boundingsphereradius); } void Model::CalculateNormals(bool facenormalise) { if(visibleloading) pgame->LoadingScreen(); static int i; if(type!=normaltype&&type!=decalstype)return; for(i=0; i=0&&Triangles[i].vertex[1]>=0&&Triangles[i].vertex[2]>=0){ if(isnormal(vertex[Triangles[i].vertex[0]].x)&&isnormal(vertex[Triangles[i].vertex[0]].y)&&isnormal(vertex[Triangles[i].vertex[0]].z) &&isnormal(vertex[Triangles[i].vertex[1]].x)&&isnormal(vertex[Triangles[i].vertex[1]].y)&&isnormal(vertex[Triangles[i].vertex[1]].z) &&isnormal(vertex[Triangles[i].vertex[2]].x)&&isnormal(vertex[Triangles[i].vertex[2]].y)&&isnormal(vertex[Triangles[i].vertex[2]].z)){ */ glTexCoord2f(Triangles[i].gx[0],Triangles[i].gy[0]); if(color)glColor3f(normals[Triangles[i].vertex[0]].x,normals[Triangles[i].vertex[0]].y,normals[Triangles[i].vertex[0]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[0]].x,normals[Triangles[i].vertex[0]].y,normals[Triangles[i].vertex[0]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[0]].x,vertex[Triangles[i].vertex[0]].y,vertex[Triangles[i].vertex[0]].z); glTexCoord2f(Triangles[i].gx[1],Triangles[i].gy[1]); if(color)glColor3f(normals[Triangles[i].vertex[1]].x,normals[Triangles[i].vertex[1]].y,normals[Triangles[i].vertex[1]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[1]].x,normals[Triangles[i].vertex[1]].y,normals[Triangles[i].vertex[1]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[1]].x,vertex[Triangles[i].vertex[1]].y,vertex[Triangles[i].vertex[1]].z); glTexCoord2f(Triangles[i].gx[2],Triangles[i].gy[2]); if(color)glColor3f(normals[Triangles[i].vertex[2]].x,normals[Triangles[i].vertex[2]].y,normals[Triangles[i].vertex[2]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[2]].x,normals[Triangles[i].vertex[2]].y,normals[Triangles[i].vertex[2]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[2]].x,vertex[Triangles[i].vertex[2]].y,vertex[Triangles[i].vertex[2]].z); //} //} } glEnd(); } void Model::draw() { if(type!=normaltype&&type!=decalstype)return; glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if(!color)glInterleavedArrays( GL_T2F_N3F_V3F,8*sizeof(GLfloat),&vArray[0]); if(color)glInterleavedArrays( GL_T2F_C3F_V3F,8*sizeof(GLfloat),&vArray[0]); glBindTexture(GL_TEXTURE_2D,(unsigned long)textureptr); #if PLATFORM_MACOSX glLockArraysEXT( 0, TriangleNum*3); #endif glDrawArrays(GL_TRIANGLES, 0, TriangleNum*3); #if PLATFORM_MACOSX glUnlockArraysEXT(); #endif if(!color)glDisableClientState(GL_NORMAL_ARRAY); if(color)glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); //drawimmediate(); } void Model::drawdifftex(GLuint texture) { glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if(!color)glInterleavedArrays( GL_T2F_N3F_V3F,8*sizeof(GLfloat),&vArray[0]); if(color)glInterleavedArrays( GL_T2F_C3F_V3F,8*sizeof(GLfloat),&vArray[0]); glBindTexture(GL_TEXTURE_2D,(unsigned long)texture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); #ifndef WIN32 glLockArraysEXT( 0, TriangleNum*3); #endif glDrawArrays(GL_TRIANGLES, 0, TriangleNum*3); #ifndef WIN32 glUnlockArraysEXT(); #endif if(!color)glDisableClientState(GL_NORMAL_ARRAY); if(color)glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); //drawdiffteximmediate(texture); } void Model::drawdiffteximmediate(GLuint texture) { glBindTexture(GL_TEXTURE_2D,(unsigned long)texture); glBegin(GL_TRIANGLES); for(int i=0;i=0&&Triangles[i].vertex[1]>=0&&Triangles[i].vertex[2]>=0){ if(isnormal(vertex[Triangles[i].vertex[0]].x)&&isnormal(vertex[Triangles[i].vertex[0]].y)&&isnormal(vertex[Triangles[i].vertex[0]].z) &&isnormal(vertex[Triangles[i].vertex[1]].x)&&isnormal(vertex[Triangles[i].vertex[1]].y)&&isnormal(vertex[Triangles[i].vertex[1]].z) &&isnormal(vertex[Triangles[i].vertex[2]].x)&&isnormal(vertex[Triangles[i].vertex[2]].y)&&isnormal(vertex[Triangles[i].vertex[2]].z)){ */glTexCoord2f(Triangles[i].gx[0],Triangles[i].gy[0]); if(color)glColor3f(normals[Triangles[i].vertex[0]].x,normals[Triangles[i].vertex[0]].y,normals[Triangles[i].vertex[0]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[0]].x,normals[Triangles[i].vertex[0]].y,normals[Triangles[i].vertex[0]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[0]].x,vertex[Triangles[i].vertex[0]].y,vertex[Triangles[i].vertex[0]].z); glTexCoord2f(Triangles[i].gx[1],Triangles[i].gy[1]); if(color)glColor3f(normals[Triangles[i].vertex[1]].x,normals[Triangles[i].vertex[1]].y,normals[Triangles[i].vertex[1]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[1]].x,normals[Triangles[i].vertex[1]].y,normals[Triangles[i].vertex[1]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[1]].x,vertex[Triangles[i].vertex[1]].y,vertex[Triangles[i].vertex[1]].z); glTexCoord2f(Triangles[i].gx[2],Triangles[i].gy[2]); if(color)glColor3f(normals[Triangles[i].vertex[2]].x,normals[Triangles[i].vertex[2]].y,normals[Triangles[i].vertex[2]].z); if(!color&&!flat)glNormal3f(normals[Triangles[i].vertex[2]].x,normals[Triangles[i].vertex[2]].y,normals[Triangles[i].vertex[2]].z); if(!color&&flat)glNormal3f(facenormals[i].x,facenormals[i].y,facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[2]].x,vertex[Triangles[i].vertex[2]].y,vertex[Triangles[i].vertex[2]].z); //} //} } glEnd(); } void Model::drawdecals(GLuint shadowtexture,GLuint bloodtexture,GLuint bloodtexture2,GLuint breaktexture) { if(decals){ if(type!=decalstype)return; static int i,j; static float distancemult; static int lasttype; static float viewdistsquared; static bool blend; viewdistsquared=viewdistance*viewdistance; blend=1; lasttype=-1; glEnable(GL_BLEND); glDisable(GL_LIGHTING); glDisable(GL_CULL_FACE); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glDepthMask(0); if(numdecals>max_model_decals)numdecals=max_model_decals; for(i=0;i58)glColor4f(1,1,1,decalopacity[i]*(60-decalalivetime[i])/2); } if((decaltype[i]==blooddecal||decaltype[i]==blooddecalfast||decaltype[i]==blooddecalslow)){ glColor4f(1,1,1,decalopacity[i]); if(decalalivetime[i]<4)glColor4f(1,1,1,decalopacity[i]*decalalivetime[i]*.25); if(decalalivetime[i]>58)glColor4f(1,1,1,decalopacity[i]*(60-decalalivetime[i])/2); } lasttype=decaltype[i]; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glBegin(GL_TRIANGLES); for(int j=0;j<3;j++) { glTexCoord2f(decaltexcoords[i][j][0], decaltexcoords[i][j][1]); glVertex3f(decalvertex[i][j].x,decalvertex[i][j].y,decalvertex[i][j].z); } glEnd(); glPopMatrix(); } for(i=numdecals-1;i>=0;i--){ decalalivetime[i]+=multiplier; if(decaltype[i]==blooddecalslow)decalalivetime[i]-=multiplier*2/3; if(decaltype[i]==blooddecalfast)decalalivetime[i]+=multiplier*4; if(decaltype[i]==shadowdecal)DeleteDecal(i); if((decaltype[i]==blooddecal||decaltype[i]==blooddecalfast||decaltype[i]==blooddecalslow)&&decalalivetime[i]>=60)DeleteDecal(i); } glAlphaFunc(GL_GREATER, 0.0001); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); } } void Model::DeleteDecal(int which) { if(decals){ if(type!=decalstype)return; decaltype[which]=decaltype[numdecals-1]; decalposition[which]=decalposition[numdecals-1]; for(int i=0;i<3;i++){ decalvertex[which][i]=decalvertex[numdecals-1][i]; decaltexcoords[which][i][0]=decaltexcoords[numdecals-1][i][0]; decaltexcoords[which][i][1]=decaltexcoords[numdecals-1][i][1]; } decalrotation[which]=decalrotation[numdecals-1]; decalalivetime[which]=decalalivetime[numdecals-1]; decalopacity[which]=decalopacity[numdecals-1]; numdecals--; } } void Model::MakeDecal(int atype, XYZ *where,float *size, float *opacity, float *rotation){ if(decals){ if(type!=decalstype)return; static float placex,placez; static XYZ rot; //static XYZ point,point1,point2; static float distance; static int i,j; if(*opacity>0) if(findDistancefast(where,&boundingspherecenter)<(boundingsphereradius+*size)*(boundingsphereradius+*size)) for(i=0;iy||vertex[Triangles[i].vertex[1]].yy||vertex[Triangles[i].vertex[2]].yy)){ decalposition[numdecals]=*where; decaltype[numdecals]=atype; decalrotation[numdecals]=*rotation; decalalivetime[numdecals]=0; distance=abs(((facenormals[i].x*where->x)+(facenormals[i].y*where->y)+(facenormals[i].z*where->z)-((facenormals[i].x*vertex[Triangles[i].vertex[0]].x)+(facenormals[i].y*vertex[Triangles[i].vertex[0]].y)+(facenormals[i].z*vertex[Triangles[i].vertex[0]].z)))/facenormals[i].y); decalopacity[numdecals]=*opacity-distance/10; if(decalopacity[numdecals>0]){ placex=vertex[Triangles[i].vertex[0]].x; placez=vertex[Triangles[i].vertex[0]].z; decaltexcoords[numdecals][0][0]=(placex-where->x)/(*size)/2+.5; decaltexcoords[numdecals][0][1]=(placez-where->z)/(*size)/2+.5; decalvertex[numdecals][0].x=placex; decalvertex[numdecals][0].z=placez; decalvertex[numdecals][0].y=vertex[Triangles[i].vertex[0]].y; placex=vertex[Triangles[i].vertex[1]].x; placez=vertex[Triangles[i].vertex[1]].z; decaltexcoords[numdecals][1][0]=(placex-where->x)/(*size)/2+.5; decaltexcoords[numdecals][1][1]=(placez-where->z)/(*size)/2+.5; decalvertex[numdecals][1].x=placex; decalvertex[numdecals][1].z=placez; decalvertex[numdecals][1].y=vertex[Triangles[i].vertex[1]].y; placex=vertex[Triangles[i].vertex[2]].x; placez=vertex[Triangles[i].vertex[2]].z; decaltexcoords[numdecals][2][0]=(placex-where->x)/(*size)/2+.5; decaltexcoords[numdecals][2][1]=(placez-where->z)/(*size)/2+.5; decalvertex[numdecals][2].x=placex; decalvertex[numdecals][2].z=placez; decalvertex[numdecals][2].y=vertex[Triangles[i].vertex[2]].y; if(!(decaltexcoords[numdecals][0][0]<0&&decaltexcoords[numdecals][1][0]<0&&decaltexcoords[numdecals][2][0]<0)) if(!(decaltexcoords[numdecals][0][1]<0&&decaltexcoords[numdecals][1][1]<0&&decaltexcoords[numdecals][2][1]<0)) if(!(decaltexcoords[numdecals][0][0]>1&&decaltexcoords[numdecals][1][0]>1&&decaltexcoords[numdecals][2][0]>1)) if(!(decaltexcoords[numdecals][0][1]>1&&decaltexcoords[numdecals][1][1]>1&&decaltexcoords[numdecals][2][1]>1)) { if(decalrotation[numdecals]){ for(j=0;j<3;j++){ rot.y=0; rot.x=decaltexcoords[numdecals][j][0]-.5; rot.z=decaltexcoords[numdecals][j][1]-.5; rot=DoRotation(rot,0,-decalrotation[numdecals],0); decaltexcoords[numdecals][j][0]=rot.x+.5; decaltexcoords[numdecals][j][1]=rot.z+.5; } } if(numdecals0) if(findDistancefast(&where,&boundingspherecenter)<(boundingsphereradius+size)*(boundingsphereradius+size)) for(i=0;iabs(facenormals[i].x)&&abs(facenormals[i].y)>abs(facenormals[i].z)){ decalposition[numdecals]=where; decaltype[numdecals]=atype; decalrotation[numdecals]=rotation; decalalivetime[numdecals]=0; decalopacity[numdecals]=opacity-distance/10; if(decalopacity[numdecals>0]){ placex=vertex[Triangles[i].vertex[0]].x; placez=vertex[Triangles[i].vertex[0]].z; decaltexcoords[numdecals][0][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][0][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][0].x=placex; decalvertex[numdecals][0].z=placez; decalvertex[numdecals][0].y=vertex[Triangles[i].vertex[0]].y; placex=vertex[Triangles[i].vertex[1]].x; placez=vertex[Triangles[i].vertex[1]].z; decaltexcoords[numdecals][1][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][1][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][1].x=placex; decalvertex[numdecals][1].z=placez; decalvertex[numdecals][1].y=vertex[Triangles[i].vertex[1]].y; placex=vertex[Triangles[i].vertex[2]].x; placez=vertex[Triangles[i].vertex[2]].z; decaltexcoords[numdecals][2][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][2][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][2].x=placex; decalvertex[numdecals][2].z=placez; decalvertex[numdecals][2].y=vertex[Triangles[i].vertex[2]].y; if(!(decaltexcoords[numdecals][0][0]<0&&decaltexcoords[numdecals][1][0]<0&&decaltexcoords[numdecals][2][0]<0)) if(!(decaltexcoords[numdecals][0][1]<0&&decaltexcoords[numdecals][1][1]<0&&decaltexcoords[numdecals][2][1]<0)) if(!(decaltexcoords[numdecals][0][0]>1&&decaltexcoords[numdecals][1][0]>1&&decaltexcoords[numdecals][2][0]>1)) if(!(decaltexcoords[numdecals][0][1]>1&&decaltexcoords[numdecals][1][1]>1&&decaltexcoords[numdecals][2][1]>1)) { if(decalrotation[numdecals]){ for(j=0;j<3;j++){ rot.y=0; rot.x=decaltexcoords[numdecals][j][0]-.5; rot.z=decaltexcoords[numdecals][j][1]-.5; rot=DoRotation(rot,0,-decalrotation[numdecals],0); decaltexcoords[numdecals][j][0]=rot.x+.5; decaltexcoords[numdecals][j][1]=rot.z+.5; } } if(numdecalsabs(facenormals[i].y)&&abs(facenormals[i].x)>abs(facenormals[i].z)){ decalposition[numdecals]=where; decaltype[numdecals]=atype; decalrotation[numdecals]=rotation; decalalivetime[numdecals]=0; decalopacity[numdecals]=opacity-distance/10; if(decalopacity[numdecals>0]){ placex=vertex[Triangles[i].vertex[0]].y; placez=vertex[Triangles[i].vertex[0]].z; decaltexcoords[numdecals][0][0]=(placex-where.y)/(size)/2+.5; decaltexcoords[numdecals][0][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][0].x=vertex[Triangles[i].vertex[0]].x; decalvertex[numdecals][0].z=placez; decalvertex[numdecals][0].y=placex; placex=vertex[Triangles[i].vertex[1]].y; placez=vertex[Triangles[i].vertex[1]].z; decaltexcoords[numdecals][1][0]=(placex-where.y)/(size)/2+.5; decaltexcoords[numdecals][1][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][1].x=vertex[Triangles[i].vertex[1]].x; decalvertex[numdecals][1].z=placez; decalvertex[numdecals][1].y=placex; placex=vertex[Triangles[i].vertex[2]].y; placez=vertex[Triangles[i].vertex[2]].z; decaltexcoords[numdecals][2][0]=(placex-where.y)/(size)/2+.5; decaltexcoords[numdecals][2][1]=(placez-where.z)/(size)/2+.5; decalvertex[numdecals][2].x=vertex[Triangles[i].vertex[2]].x; decalvertex[numdecals][2].z=placez; decalvertex[numdecals][2].y=placex; if(!(decaltexcoords[numdecals][0][0]<0&&decaltexcoords[numdecals][1][0]<0&&decaltexcoords[numdecals][2][0]<0)) if(!(decaltexcoords[numdecals][0][1]<0&&decaltexcoords[numdecals][1][1]<0&&decaltexcoords[numdecals][2][1]<0)) if(!(decaltexcoords[numdecals][0][0]>1&&decaltexcoords[numdecals][1][0]>1&&decaltexcoords[numdecals][2][0]>1)) if(!(decaltexcoords[numdecals][0][1]>1&&decaltexcoords[numdecals][1][1]>1&&decaltexcoords[numdecals][2][1]>1)) { if(decalrotation[numdecals]){ for(j=0;j<3;j++){ rot.y=0; rot.x=decaltexcoords[numdecals][j][0]-.5; rot.z=decaltexcoords[numdecals][j][1]-.5; rot=DoRotation(rot,0,-decalrotation[numdecals],0); decaltexcoords[numdecals][j][0]=rot.x+.5; decaltexcoords[numdecals][j][1]=rot.z+.5; } } if(numdecalsabs(facenormals[i].y)&&abs(facenormals[i].z)>abs(facenormals[i].x)){ decalposition[numdecals]=where; decaltype[numdecals]=atype; decalrotation[numdecals]=rotation; decalalivetime[numdecals]=0; decalopacity[numdecals]=opacity-distance/10; if(decalopacity[numdecals>0]){ placex=vertex[Triangles[i].vertex[0]].x; placez=vertex[Triangles[i].vertex[0]].y; decaltexcoords[numdecals][0][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][0][1]=(placez-where.y)/(size)/2+.5; decalvertex[numdecals][0].x=placex; decalvertex[numdecals][0].z=vertex[Triangles[i].vertex[0]].z; decalvertex[numdecals][0].y=placez; placex=vertex[Triangles[i].vertex[1]].x; placez=vertex[Triangles[i].vertex[1]].y; decaltexcoords[numdecals][1][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][1][1]=(placez-where.y)/(size)/2+.5; decalvertex[numdecals][1].x=placex; decalvertex[numdecals][1].z=vertex[Triangles[i].vertex[1]].z; decalvertex[numdecals][1].y=placez; placex=vertex[Triangles[i].vertex[2]].x; placez=vertex[Triangles[i].vertex[2]].y; decaltexcoords[numdecals][2][0]=(placex-where.x)/(size)/2+.5; decaltexcoords[numdecals][2][1]=(placez-where.y)/(size)/2+.5; decalvertex[numdecals][2].x=placex; decalvertex[numdecals][2].z=vertex[Triangles[i].vertex[2]].z; decalvertex[numdecals][2].y=placez; if(!(decaltexcoords[numdecals][0][0]<0&&decaltexcoords[numdecals][1][0]<0&&decaltexcoords[numdecals][2][0]<0)) if(!(decaltexcoords[numdecals][0][1]<0&&decaltexcoords[numdecals][1][1]<0&&decaltexcoords[numdecals][2][1]<0)) if(!(decaltexcoords[numdecals][0][0]>1&&decaltexcoords[numdecals][1][0]>1&&decaltexcoords[numdecals][2][0]>1)) if(!(decaltexcoords[numdecals][0][1]>1&&decaltexcoords[numdecals][1][1]>1&&decaltexcoords[numdecals][2][1]>1)) { if(decalrotation[numdecals]){ for(j=0;j<3;j++){ rot.y=0; rot.x=decaltexcoords[numdecals][j][0]-.5; rot.z=decaltexcoords[numdecals][j][1]-.5; rot=DoRotation(rot,0,-decalrotation[numdecals],0); decaltexcoords[numdecals][j][0]=rot.x+.5; decaltexcoords[numdecals][j][1]=rot.z+.5; } } if(numdecals HEADER FILES <**/ #include "Game.h" #include "TGALoader.h" extern float texdetail; extern TGAImageRec texture; extern short vRefNum; extern long dirID; extern bool visibleloading; extern Game * pgame; extern bool LoadImage(const char * fname, TGAImageRec & tex); /********************> LoadTGA() <*****/ bool upload_image(const unsigned char* filePath, bool hasalpha) { if(visibleloading) pgame->LoadingScreen(); #if !PLATFORM_MACOSX // for Windows, just use TGA loader for now char fileName[256]; CopyPascalStringToC( filePath, fileName); /* // change extension to .TGA int len = strlen( fileName); if (len > 3) { fileName[ len - 3] = 't'; fileName[ len - 2] = 'g'; fileName[ len - 1] = 'a'; } */ // return (LoadTGA( fileName) != NULL); return (LoadImage(fileName, texture)); #else OSStatus err; ComponentResult cr; /*FSRef fsref; Boolean isdir; err = FSPathMakeRef((const UInt8*)filePath, &fsref, &isdir); if(err)return; FSSpec fsspec; err = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, NULL, &fsspec, NULL); if(err)return; */ //Boolean isdir; FSSpec fsspec; //err = FSMakeFSSpec (0, 0, (const unsigned char*)filePath, &fsspec); err = FSMakeFSSpec (0, 0, filePath, &fsspec); //err=FSPathMakeFSSpec((const UInt8*)filePath,&fsspec,&isdir);*/ if(err)return; GraphicsImportComponent gi; err = GetGraphicsImporterForFile(&fsspec, &gi); if(err)return; Rect natbounds; cr = GraphicsImportGetNaturalBounds(gi, &natbounds); //~ size_t buffersize = 4 * natbounds.bottom * natbounds.right; //void* buf = malloc(buffersize); texture.sizeX=natbounds.right; texture.sizeY=natbounds.bottom; /*if(hasalpha)*/texture.bpp = 32; //if(!hasalpha)texture.bpp = 24; GWorldPtr gw; err = QTNewGWorldFromPtr(&gw, k32ARGBPixelFormat, &natbounds, NULL, NULL, 0, texture.data, 4 * natbounds.right); if(err)return; cr = GraphicsImportSetGWorld(gi, gw, NULL); natbounds.top = natbounds.bottom; natbounds.bottom = 0; cr = GraphicsImportSetBoundsRect(gi, &natbounds); cr = GraphicsImportDraw(gi); err = CloseComponent(gi); if(err)return; /*glTexImage2D(textureTarget, 0, GL_RGBA, natbounds.right, natbounds.top, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buf); */ //free(buf); DisposeGWorld(gw); // Loop Through The Image Data GLuint imageSize; // Used To Store The Image Size When Setting Aside Ram GLuint temp; // Temporary Variable GLuint bytesPerPixel; // Temporary Variable bytesPerPixel=texture.bpp/8; imageSize = texture.sizeX * texture.sizeY * bytesPerPixel; //~ int alltrans=10; for( GLuint i = 0; i < int( imageSize ); i += 4 ) { // Swaps The 1st And 3rd Bytes ('R'ed and 'B'lue) temp = texture.data[i]; // Temporarily Store The Value At Image Data 'i' texture.data[i] = texture.data[i + 1]; // Set The 1st Byte To The Value Of The 3rd Byte texture.data[i + 1] = texture.data[i + 2]; // Set The 3rd Byte To The Value In 'temp' (1st Byte Value) texture.data[i + 2] = texture.data[i + 3]; texture.data[i + 3] = temp; } //~ int tempplace; //~ tempplace=0; if(!hasalpha){ for( GLuint i = 0; i < int( imageSize ); i += 4 ) { texture.data[i + 3] = 255; /*texture.data[tempplace] = texture.data[i]; // Set The 1st Byte To The Value Of The 3rd Byte texture.data[tempplace + 1] = texture.data[i + 1]; // Set The 3rd Byte To The Value In 'temp' (1st Byte Value) texture.data[tempplace + 2] = texture.data[i + 2]; tempplace+=3;*/ } } if(texdetail>1){ int which=0; float temp; float howmany; for( GLuint k = 0; k < int( imageSize); k += bytesPerPixel*texture.sizeX*texdetail ) { for( GLuint i = 0; i < int( imageSize/texture.sizeY ); i += bytesPerPixel*texdetail ) { for( GLuint b = 0; b < bytesPerPixel ; b ++ ){ temp=0; howmany=0; for( GLuint l = 0; l < texdetail*texture.sizeX ; l +=texture.sizeX ){ for( GLuint j = 0; j < texdetail ; j ++ ) { temp += (int)texture.data[k+i+j*bytesPerPixel+l*bytesPerPixel+b]; // Set The 1st Byte To The Value Of The 3rd Byte howmany++; } } texture.data[which+b]=GLubyte(temp/howmany); } which+=bytesPerPixel; } } texture.sizeX/=texdetail; texture.sizeY/=texdetail; } return true; #endif } lugaru-0~20110520.1+hge4354.orig/Source/Texture.cpp0000644000000000000000000000502711571222446020012 0ustar rootroot#include "gamegl.h" #include "Texture.h" #include "TGALoader.h" using namespace std; map Texture::textures; extern TGAImageRec texture; extern bool trilinear; Texture::~Texture() { free(array); if(id) glDeleteTextures(1,&id); } void Texture::load() { GLuint type; LOGFUNC; LOG(std::string("Loading texture...") + fileName); unsigned char fileNamep[256]; CopyCStringToPascal(ConvertFileName(fileName.c_str()), fileNamep); //Load Image upload_image( fileNamep ,hasalpha); //Alpha channel? if ( texture.bpp == 24 ) type = GL_RGB; else type = GL_RGBA; glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); if(!id) glGenTextures( 1, &id ); glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glBindTexture( GL_TEXTURE_2D, id); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); if(mipmap) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (trilinear?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST) ); else glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); skinsize=texture.sizeX; if(isSkin) { int tempnum=0; int nb = (texture.sizeY*texture.sizeX*(texture.bpp/8)); array = (GLubyte*)malloc(nb*sizeof(GLubyte)); for(int i=0;i::iterator it = textures.find(fileName); if(it==textures.end()) { textures.insert(make_pair(fileName,Texture(fileName,mipmap,hasalpha))); textures[fileName].load(); return textures[fileName].getId(); } else { return it->second.getId(); } } GLuint Texture::Load(const string& fileName, bool mipmap, bool hasalpha, GLubyte* array, int* skinsize) { map::iterator it = textures.find(fileName); if(it==textures.end()) { textures.insert(make_pair(fileName,Texture(fileName,mipmap,hasalpha,true))); textures[fileName].load(); *skinsize = textures[fileName].skinsize; for(int i=0;isecond.skinsize; for(int i=0;isecond.arraySize;i++) { array[i] = it->second.array[i]; } return it->second.getId(); } } lugaru-0~20110520.1+hge4354.orig/Source/GameTick.cpp0000644000000000000000000130055711571222446020045 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if PLATFORM_UNIX #include #include #include #else #include #endif #include #include #include "Game.h" #include "openal_wrapper.h" #include "Settings.h" #include "Input.h" #include "Animation.h" #include "Awards.h" #include using namespace std; // Added more evilness needed for MSVC #ifdef _MSC_VER #define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) #define snprintf(buf, size, format, ...) _sprintf_p(buf, size, format) #endif extern float multiplier; extern XYZ viewer; extern int environment; extern Terrain terrain; extern float screenwidth,screenheight; extern float gravity; extern int detail; extern float texdetail; extern Objects objects; extern int slomo; extern float slomodelay; extern bool floatjump; extern float volume; extern Light light; extern float camerashake; extern float woozy; extern float blackout; extern bool cellophane; extern bool musictoggle; extern int difficulty; extern int bloodtoggle; extern bool invertmouse; extern float windvar; extern float precipdelay; extern XYZ viewerfacing; extern bool ambientsound; extern bool mousejump; extern float viewdistance; extern bool freeze; extern bool keyboardfrozen; extern bool loadingstuff; extern XYZ windvector; extern bool debugmode; static int leveltheme; extern int mainmenu; extern bool visibleloading; extern XYZ envsound[30]; extern float envsoundvol[30]; extern int numenvsounds; extern float envsoundlife[30]; extern float usermousesensitivity; extern bool ismotionblur; extern bool showdamagebar; // (des)activate the damage bar extern bool decals; extern float tintr,tintg,tintb; extern bool skyboxtexture; extern float skyboxr; extern float skyboxg; extern float skyboxb; extern float skyboxlightr; extern float skyboxlightg; extern float skyboxlightb; extern float fadestart; extern float slomospeed; extern float slomofreq; extern int tutoriallevel; extern float smoketex; extern float tutorialstagetime; extern int tutorialstage; extern float tutorialmaxtime; extern float tutorialsuccess; extern bool againbonus; extern bool reversaltrain; extern bool canattack; extern bool cananger; extern float damagedealt; extern int maptype; extern int editoractive; extern int editorpathtype; extern float hostiletime; extern bool gamestarted; extern int numhotspots; extern int killhotspot; extern XYZ hotspot[40]; extern int hotspottype[40]; extern float hotspotsize[40]; extern char hotspottext[40][256]; extern int currenthotspot; extern int hostile; extern bool stillloading; extern bool winfreeze; extern bool campaign; static const char *rabbitskin[] = { ":Data:Textures:Fur3.jpg", ":Data:Textures:Fur.jpg", ":Data:Textures:Fur2.jpg", ":Data:Textures:Lynx.jpg", ":Data:Textures:Otter.jpg", ":Data:Textures:Opal.jpg", ":Data:Textures:Sable.jpg", ":Data:Textures:Chocolate.jpg", ":Data:Textures:BW2.jpg", ":Data:Textures:WB2.jpg" }; static const char *wolfskin[] = { ":Data:Textures:Wolf.jpg", ":Data:Textures:Darkwolf.jpg", ":Data:Textures:Snowwolf.jpg" }; #define STATIC_ASSERT(x) extern int s_a_dummy[2 * (!!(x)) - 1]; STATIC_ASSERT (rabbittype == 0 && wolftype == 1) static const char **creatureskin[] = {rabbitskin, wolfskin}; /* Return true if PFX is a prefix of STR (case-insensitive). */ static bool stripfx(const char *str, const char *pfx) { return !strncasecmp(str, pfx, strlen(pfx)); } static const char *cmd_names[] = { #define DECLARE_COMMAND(cmd) #cmd, #include "ConsoleCmds.h" #undef DECLARE_COMMAND }; typedef void (*console_handler)(Game *game, const char *args); #define DECLARE_COMMAND(cmd) static void ch_##cmd(Game *game, const char *args); #include "ConsoleCmds.h" #undef DECLARE_COMMAND static console_handler cmd_handlers[] = { #define DECLARE_COMMAND(cmd) ch_##cmd, #include "ConsoleCmds.h" #undef DECLARE_COMMAND }; // added utility functions -sf17k ============================================================= //TODO: this is incorrect but I'm afraid to change it and break something, //probably causes quirky behavior that I might want to preserve inline float roughDirection(XYZ vec){ Normalise(&vec); float angle=-asin(-vec.x)*180/M_PI; if(vec.z<0) angle=180-angle; return angle; } inline float roughDirectionTo(XYZ start, XYZ end){ return roughDirection(end-start); } //TODO: gotta be a better way inline float pitch(XYZ vec){ Normalise(&vec); return -asin(vec.y)*180/M_PI; } inline float pitchTo(XYZ start, XYZ end){ return pitch(end-start); } inline float sq(float n) { return n*n; } inline float stepTowardf(float from, float to, float by){ if(fabs(from-to)to) return from-by; else return from+by; } void playdialogueboxsound(){ XYZ temppos; temppos=player[participantfocus[whichdialogue][indialogue]].coords; temppos=temppos-viewer; Normalise(&temppos); temppos+=viewer; int sound=-1; switch(dialogueboxsound[whichdialogue][indialogue]){ case -6: sound=alarmsound; break; case -4: sound=consolefailsound; break; case -3: sound=consolesuccesssound; break; case -2: sound=firestartsound; break; case -1: sound=fireendsound; break; case 1: sound=rabbitchitter; break; case 2: sound=rabbitchitter2; break; case 3: sound=rabbitpainsound; break; case 4: sound=rabbitpain1sound; break; case 5: sound=rabbitattacksound; break; case 6: sound=rabbitattack2sound; break; case 7: sound=rabbitattack3sound; break; case 8: sound=rabbitattack4sound; break; case 9: sound=growlsound; break; case 10: sound=growl2sound; break; case 11: sound=snarlsound; break; case 12: sound=snarl2sound; break; case 13: sound=barksound; break; case 14: sound=bark2sound; break; case 15: sound=bark3sound; break; case 16: sound=barkgrowlsound; break; default: break; } if(sound!=-1) emit_sound_at(sound, temppos); } // end added utility functions ================================================================ static void ch_quit(Game *game, const char *args) { game->tryquit = 1; } static void ch_map(Game *game, const char *args) { game->Loadlevel(args); game->whichlevel = -2; campaign = 0; } static void ch_save(Game *game, const char *args){ char buf[64]; snprintf(buf, 63, ":Data:Maps:%s", args); int mapvers = 12; FILE *tfile; tfile=fopen( ConvertFileName(buf), "wb" ); fpackf(tfile, "Bi", mapvers); fpackf(tfile, "Bi", maptype); fpackf(tfile, "Bi", hostile); fpackf(tfile, "Bf Bf", viewdistance, fadestart); fpackf(tfile, "Bb Bf Bf Bf", skyboxtexture, skyboxr, skyboxg, skyboxb); fpackf(tfile, "Bf Bf Bf", skyboxlightr, skyboxlightg, skyboxlightb); fpackf(tfile, "Bf Bf Bf Bf Bf Bi", player[0].coords.x, player[0].coords.y, player[0].coords.z, player[0].rotation, player[0].targetrotation, player[0].num_weapons); if(player[0].num_weapons>0&&player[0].num_weapons<5) for(int j=0;jnumpathpoints); for(int j=0;jnumpathpoints;j++){ fpackf(tfile, "Bf Bf Bf Bi", game->pathpoint[j].x, game->pathpoint[j].y, game->pathpoint[j].z, game->numpathpointconnect[j]); for(int k=0;knumpathpointconnect[j];k++) fpackf(tfile, "Bi", game->pathpointconnect[j][k]); } fpackf(tfile, "Bf Bf Bf Bf", game->mapcenter.x, game->mapcenter.y, game->mapcenter.z, game->mapradius); fclose(tfile); } static void ch_cellar(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:Furdarko.jpg",&player[0].skeleton.drawmodel.textureptr,1,&player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_tint(Game *game, const char *args) { sscanf(args, "%f%f%f", &tintr, &tintg, &tintb); } static void ch_tintr(Game *game, const char *args) { tintr = atof(args); } static void ch_tintg(Game *game, const char *args) { tintg = atof(args); } static void ch_tintb(Game *game, const char *args) { tintb = atof(args); } static void ch_speed(Game *game, const char *args) { player[0].speedmult = atof(args); } static void ch_strength(Game *game, const char *args) { player[0].power = atof(args); } static void ch_power(Game *game, const char *args) { player[0].power = atof(args); } static void ch_size(Game *game, const char *args) { player[0].scale = atof(args) * .2; } static int find_closest() { int closest = 0; float closestdist = std::numeric_limits::max(); for (int i = 1; i < numplayers; i++) { float distance; distance = findDistancefast(&player[i].coords,&player[0].coords); if (distance < closestdist) { closestdist = distance; closest = i; } } return closest; } static void ch_sizenear(Game *game, const char *args) { int closest = find_closest(); if (closest) player[closest].scale = atof(args) * .2; } static void set_proportion(int pnum, const char *args) { float headprop,bodyprop,armprop,legprop; sscanf(args, "%f%f%f%f", &headprop, &bodyprop, &armprop, &legprop); if(player[pnum].creature==wolftype){ player[pnum].proportionhead=1.1*headprop; player[pnum].proportionbody=1.1*bodyprop; player[pnum].proportionarms=1.1*armprop; player[pnum].proportionlegs=1.1*legprop; } else if(player[pnum].creature==rabbittype){ player[pnum].proportionhead=1.2*headprop; player[pnum].proportionbody=1.05*bodyprop; player[pnum].proportionarms=1.00*armprop; player[pnum].proportionlegs=1.1*legprop; player[pnum].proportionlegs.y=1.05*legprop; } } static void ch_proportion(Game *game, const char *args) { set_proportion(0, args); } static void ch_proportionnear(Game *game, const char *args) { int closest = find_closest(); if (closest) set_proportion(closest, args); } static void set_protection(int pnum, const char *args) { float head, high, low; sscanf(args, "%f%f%f", &head, &high, &low); player[pnum].protectionhead = head; player[pnum].protectionhigh = high; player[pnum].protectionlow = low; } static void ch_protection(Game *game, const char *args) { set_protection(0, args); } static void ch_protectionnear(Game *game, const char *args) { int closest = find_closest(); if (closest) set_protection(closest, args); } static void set_armor(int pnum, const char *args) { float head, high, low; sscanf(args, "%f%f%f", &head, &high, &low); player[pnum].armorhead = head; player[pnum].armorhigh = high; player[pnum].armorlow = low; } static void ch_armor(Game *game, const char *args) { set_armor(0, args); } static void ch_armornear(Game *game, const char *args) { int closest = find_closest(); if (closest) set_armor(closest, args); } static void ch_protectionreset(Game *game, const char *args) { set_protection(0, "1 1 1"); set_armor(0, "1 1 1"); } static void set_metal(int pnum, const char *args) { float head, high, low; sscanf(args, "%f%f%f", &head, &high, &low); player[pnum].metalhead = head; player[pnum].metalhigh = high; player[pnum].metallow = low; } static void ch_metal(Game *game, const char *args) { set_metal(0, args); } static void set_noclothes(int pnum, Game *game, const char *args) { player[pnum].numclothes = 0; game->LoadTextureSave(creatureskin[player[pnum].creature][player[pnum].whichskin], &player[pnum].skeleton.drawmodel.textureptr,1, &player[pnum].skeleton.skinText[0],&player[pnum].skeleton.skinsize); } static void ch_noclothes(Game *game, const char *args) { set_noclothes(0, game, args); } static void ch_noclothesnear(Game *game, const char *args) { int closest = find_closest(); if (closest) set_noclothes(closest, game, args); } static void set_clothes(int pnum, Game *game, const char *args) { char buf[64]; snprintf(buf, 63, ":Data:Textures:%s.png", args); if (!game->AddClothes(buf,&player[pnum].skeleton.skinText[pnum])) return; player[pnum].DoMipmaps(); strcpy(player[pnum].clothes[player[pnum].numclothes],buf); player[pnum].clothestintr[player[pnum].numclothes]=tintr; player[pnum].clothestintg[player[pnum].numclothes]=tintg; player[pnum].clothestintb[player[pnum].numclothes]=tintb; player[pnum].numclothes++; } static void ch_clothes(Game *game, const char *args) { set_clothes(0, game, args); } static void ch_clothesnear(Game *game, const char *args) { int closest = find_closest(); if (closest) set_clothes(closest, game, args); } static void ch_belt(Game *game, const char *args) { player[0].skeleton.clothes = !player[0].skeleton.clothes; } static void ch_cellophane(Game *game, const char *args) { cellophane = !cellophane; float mul = cellophane ? 0 : 1; for (int i = 0; i < numplayers; i++) { player[i].proportionhead.z = player[i].proportionhead.x * mul; player[i].proportionbody.z = player[i].proportionbody.x * mul; player[i].proportionarms.z = player[i].proportionarms.x * mul; player[i].proportionlegs.z = player[i].proportionlegs.x * mul; } } static void ch_funnybunny(Game *game, const char *args) { player[0].skeleton.id=0; player[0].skeleton.Load(":Data:Skeleton:Basic Figure",":Data:Skeleton:Basic Figurelow", ":Data:Skeleton:Rabbitbelt",":Data:Models:Body.solid", ":Data:Models:Body2.solid",":Data:Models:Body3.solid", ":Data:Models:Body4.solid",":Data:Models:Body5.solid", ":Data:Models:Body6.solid",":Data:Models:Body7.solid", ":Data:Models:Bodylow.solid",":Data:Models:Belt.solid",1); game->LoadTextureSave(":Data:Textures:fur3.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); player[0].creature=rabbittype; player[0].scale=.2; player[0].headless=0; player[0].damagetolerance=200; set_proportion(0, "1 1 1 1"); } static void ch_wolfie(Game *game, const char *args) { player[0].skeleton.id=0; player[0].skeleton.Load(":Data:Skeleton:Basic Figure Wolf",":Data:Skeleton:Basic Figure Wolf Low", ":Data:Skeleton:Rabbitbelt",":Data:Models:Wolf.solid", ":Data:Models:Wolf2.solid",":Data:Models:Wolf3.solid", ":Data:Models:Wolf4.solid",":Data:Models:Wolf5.solid", ":Data:Models:Wolf6.solid",":Data:Models:Wolf7.solid", ":Data:Models:Wolflow.solid",":Data:Models:Belt.solid",0); game->LoadTextureSave(":Data:Textures:Wolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); player[0].creature=wolftype; player[0].damagetolerance=300; set_proportion(0, "1 1 1 1"); } static void ch_wolfieisgod(Game *game, const char *args) { ch_wolfie(game, args); } static void ch_wolf(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:Wolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_snowwolf(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:SnowWolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_darkwolf(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:DarkWolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_lizardwolf(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:Lizardwolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_white(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:fur.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_brown(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:fur3.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_black(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:fur2.jpg",&player[0].skeleton.drawmodel.textureptr,1, &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } static void ch_sizemin(Game *game, const char *args) { for (int i = 1; i < numplayers; i++) if (player[i].scale < 0.8 * 0.2) player[i].scale = 0.8 * 0.2; } static void ch_tutorial(Game *game, const char *args) { tutoriallevel = atoi(args); } static void ch_hostile(Game *game, const char *args) { hostile = atoi(args); } static void ch_indemo(Game *game, const char *args) { game->indemo=1; hotspot[numhotspots]=player[0].coords; hotspotsize[numhotspots]=0; hotspottype[numhotspots]=-111; strcpy(hotspottext[numhotspots],"mapname"); numhotspots++; } static void ch_notindemo(Game *game, const char *args) { game->indemo=0; numhotspots--; } static void ch_type(Game *game, const char *args) { int n = sizeof(editortypenames) / sizeof(editortypenames[0]); for (int i = 0; i < n; i++) if (stripfx(args, editortypenames[i])) { editoractive = i; break; } } static void ch_path(Game *game, const char *args) { int n = sizeof(pathtypenames) / sizeof(pathtypenames[0]); for (int i = 0; i < n; i++) if (stripfx(args, pathtypenames[i])) { editorpathtype = i; break; } } static void ch_hs(Game *game, const char *args) { hotspot[numhotspots]=player[0].coords; float size; int type, shift; sscanf(args, "%f%d %n", &size, &type, &shift); hotspotsize[numhotspots] = size; hotspottype[numhotspots] = type; strcpy(hotspottext[numhotspots], args + shift); strcat(hotspottext[numhotspots], "\n"); numhotspots++; } static void ch_dialogue(Game *game, const char *args) { int dlg; char buf1[32], buf2[64]; sscanf(args, "%d %31s", &dlg, buf1); snprintf(buf2, 63, ":Data:Dialogues:%s.txt", buf1); dialoguetype[numdialogues] = dlg; memset(dialoguetext[numdialogues], 0, sizeof(dialoguetext[numdialogues])); memset(dialoguename[numdialogues], 0, sizeof(dialoguename[numdialogues])); ifstream ipstream(ConvertFileName(buf2)); ipstream.ignore(256,':'); ipstream >> numdialogueboxes[numdialogues]; for(int i=0;i> dialogueboxlocation[numdialogues][i]; ipstream.ignore(256,':'); ipstream >> dialogueboxcolor[numdialogues][i][0]; ipstream >> dialogueboxcolor[numdialogues][i][1]; ipstream >> dialogueboxcolor[numdialogues][i][2]; ipstream.ignore(256,':'); ipstream.getline(dialoguename[numdialogues][i],64); ipstream.ignore(256,':'); ipstream.ignore(256,' '); ipstream.getline(dialoguetext[numdialogues][i],128); for(int j=0;j<128;j++){ if(dialoguetext[numdialogues][i][j]=='\\')dialoguetext[numdialogues][i][j]='\n'; } ipstream.ignore(256,':'); ipstream >> dialogueboxsound[numdialogues][i]; } for(int i=0;i> numdialogueboxes[whichdi]; for(int i=0;i> dialogueboxlocation[whichdi][i]; ipstream.ignore(256,':'); ipstream >> dialogueboxcolor[whichdi][i][0]; ipstream >> dialogueboxcolor[whichdi][i][1]; ipstream >> dialogueboxcolor[whichdi][i][2]; ipstream.ignore(256,':'); ipstream.getline(dialoguename[whichdi][i],64); ipstream.ignore(256,':'); ipstream.ignore(256,' '); ipstream.getline(dialoguetext[whichdi][i],128); for(int j=0;j<128;j++){ if(dialoguetext[whichdi][i][j]=='\\')dialoguetext[whichdi][i][j]='\n'; } ipstream.ignore(256,':'); ipstream >> dialogueboxsound[whichdi][i]; } ipstream.close(); } static void ch_fixtype(Game *game, const char *args) { int dlg; sscanf(args, "%d", &dlg); dialoguetype[0] = dlg; } static void ch_fixrotation(Game *game, const char *args) { participantrotation[whichdialogue][participantfocus[whichdialogue][indialogue]]=player[participantfocus[whichdialogue][indialogue]].rotation; } static void ch_ddialogue(Game *game, const char *args) { if (numdialogues) numdialogues--; } static void ch_dhs(Game *game, const char *args) { if (numhotspots) numhotspots--; } static void ch_immobile(Game *game, const char *args) { player[0].immobile = 1; } static void ch_allimmobile(Game *game, const char *args) { for (int i = 1; i < numplayers; i++) player[i].immobile = 1; } static void ch_mobile(Game *game, const char *args) { player[0].immobile = 0; } static void ch_default(Game *game, const char *args) { player[0].armorhead=1; player[0].armorhigh=1; player[0].armorlow=1; player[0].protectionhead=1; player[0].protectionhigh=1; player[0].protectionlow=1; player[0].metalhead=1; player[0].metalhigh=1; player[0].metallow=1; player[0].power=1; player[0].speedmult=1; player[0].scale=1; if(player[0].creature==wolftype){ player[0].proportionhead=1.1; player[0].proportionbody=1.1; player[0].proportionarms=1.1; player[0].proportionlegs=1.1; } else if(player[0].creature==rabbittype){ player[0].proportionhead=1.2; player[0].proportionbody=1.05; player[0].proportionarms=1.00; player[0].proportionlegs=1.1; player[0].proportionlegs.y=1.05; } player[0].numclothes=0; game->LoadTextureSave(creatureskin[player[0].creature][player[0].whichskin], &player[0].skeleton.drawmodel.textureptr,1,&player[0].skeleton.skinText[0], &player[0].skeleton.skinsize); editoractive=typeactive; player[0].immobile=0; } static void ch_play(Game *game, const char *args) { int dlg; sscanf(args, "%d", &dlg); whichdialogue = dlg; if (whichdialogue >= numdialogues) return; for(int i=0;iSetUpLighting(); terrain.DoShadows(); objects.DoShadows(); } static void ch_skylight(Game *game, const char *args) { sscanf(args, "%f%f%f", &skyboxlightr, &skyboxlightg, &skyboxlightb); game->SetUpLighting(); terrain.DoShadows(); objects.DoShadows(); } static void ch_skybox(Game *game, const char *args) { skyboxtexture = !skyboxtexture; game->SetUpLighting(); terrain.DoShadows(); objects.DoShadows(); } static void cmd_dispatch(Game *game, const string cmd) { int i, n_cmds = sizeof(cmd_names) / sizeof(cmd_names[0]); for (i = 0; i < n_cmds; i++) if (cmd.substr(0,cmd.find(' '))==string(cmd_names[i])) { cout << "|" << cmd.substr(cmd.find(' ')+1) << "|" << endl; cmd_handlers[i](game, cmd.substr(cmd.find(' ')+1).c_str()); break; } emit_sound_np(i < n_cmds ? consolesuccesssound : consolefailsound); } /********************> Tick() <*****/ extern bool save_image(const char * fname); void Screenshot (void) { char temp[1024]; time_t t = time(NULL); struct tm *tme = localtime(&t); sprintf(temp, "Screenshots/Screenshot_%04d_%02d_%02d--%02d_%02d_%02d.png", tme->tm_year + 1900, tme->tm_mon + 1, tme->tm_mday, tme->tm_hour, tme->tm_min, tme->tm_sec); #if defined(_WIN32) mkdir("Screenshots"); #else mkdir("Screenshots", S_IRWXU); #endif save_image(temp); } void Game::SetUpLighting(){ if(environment==snowyenvironment) light.setColors(.65,.65,.7,.4,.4,.44); if(environment==desertenvironment) light.setColors(.95,.95,.95,.4,.35,.3); if(environment==grassyenvironment) light.setColors(.95,.95,1,.4,.4,.44); if(!skyboxtexture) light.setColors(1,1,1,.4,.4,.4); float average; average=(skyboxlightr+skyboxlightg+skyboxlightb)/3; light.color[0]*=(skyboxlightr+average)/2; light.color[1]*=(skyboxlightg+average)/2; light.color[2]*=(skyboxlightb+average)/2; light.ambient[0]*=(skyboxlightr+average)/2; light.ambient[1]*=(skyboxlightg+average)/2; light.ambient[2]*=(skyboxlightb+average)/2; } int Game::findPathDist(int start,int end){ int smallestcount,count,connected; int last,last2,last3,last4; int closest; smallestcount=1000; for(int i=0;i<50;i++){ count=0; last=start; last2=-1; last3=-1; last4=-1; while(last!=end&&count<30){ closest=-1; for(int j=0;jminx-objects.model[i].boundingsphereradius&& objects.position[i].xminy-objects.model[i].boundingsphereradius&& objects.position[i].yminz-objects.model[i].boundingsphereradius&& objects.position[i].zminx-objects.model[what].boundingsphereradius&& objects.position[what].xminy-objects.model[what].boundingsphereradius&& objects.position[what].yminz-objects.model[what].boundingsphereradius&& objects.position[what].z1)texdetail=4; skybox.load( ":Data:Textures:Skybox(snow):Front.jpg", ":Data:Textures:Skybox(snow):Left.jpg", ":Data:Textures:Skybox(snow):Back.jpg", ":Data:Textures:Skybox(snow):Right.jpg", ":Data:Textures:Skybox(snow):Up.jpg", ":Data:Textures:Skybox(snow):Down.jpg"); texdetail=temptexdetail; } else if(environment==desertenvironment){ windvector=0; windvector.z=2; LoadTexture(":Data:Textures:deserttree.png",&objects.treetextureptr,0,1); LoadTexture(":Data:Textures:bushdesert.png",&objects.bushtextureptr,0,1); LoadTexture(":Data:Textures:boulderdesert.jpg",&objects.rocktextureptr,1,0); LoadTexture(":Data:Textures:desertbox.jpg",&objects.boxtextureptr,1,0); if(ambientsound) emit_stream_np(stream_desertambient); footstepsound = footstepsn1; footstepsound2 = footstepsn2; footstepsound3 = footstepsn1; footstepsound4 = footstepsn2; LoadTexture(":Data:Textures:sand.jpg",&terraintexture,1,0); LoadTexture(":Data:Textures:sandslope.jpg",&terraintexture2,1,0); //LoadTexture(":Data:Textures:detailgrain.png",&terraintexture3,1); temptexdetail=texdetail; if(texdetail>1)texdetail=4; skybox.load( ":Data:Textures:Skybox(sand):Front.jpg", ":Data:Textures:Skybox(sand):Left.jpg", ":Data:Textures:Skybox(sand):Back.jpg", ":Data:Textures:Skybox(sand):Right.jpg", ":Data:Textures:Skybox(sand):Up.jpg", ":Data:Textures:Skybox(sand):Down.jpg"); texdetail=temptexdetail; } else if(environment==grassyenvironment){ windvector=0; windvector.z=2; LoadTexture(":Data:Textures:tree.png",&objects.treetextureptr,0,1); LoadTexture(":Data:Textures:bush.png",&objects.bushtextureptr,0,1); LoadTexture(":Data:Textures:boulder.jpg",&objects.rocktextureptr,1,0); LoadTexture(":Data:Textures:grassbox.jpg",&objects.boxtextureptr,1,0); if(ambientsound) emit_stream_np(stream_wind, 100.); footstepsound = footstepgr1; footstepsound2 = footstepgr2; footstepsound3 = footstepst1; footstepsound4 = footstepst2; LoadTexture(":Data:Textures:grassdirt.jpg",&terraintexture,1,0); LoadTexture(":Data:Textures:mossrock.jpg",&terraintexture2,1,0); //LoadTexture(":Data:Textures:detail.png",&terraintexture3,1); temptexdetail=texdetail; if(texdetail>1)texdetail=4; skybox.load( ":Data:Textures:Skybox(grass):Front.jpg", ":Data:Textures:Skybox(grass):Left.jpg", ":Data:Textures:Skybox(grass):Back.jpg", ":Data:Textures:Skybox(grass):Right.jpg", ":Data:Textures:Skybox(grass):Up.jpg", ":Data:Textures:Skybox(grass):Down.jpg"); texdetail=temptexdetail; } temptexdetail=texdetail; texdetail=1; terrain.load(":Data:Textures:heightmap.png"); texdetail=temptexdetail; } void Game::Loadlevel(int which) { stealthloading=0; whichlevel=which; if(which == -1) { tutoriallevel = -1; Loadlevel("tutorial"); } else if(which >= 0 && which <= 15) { char buf[32]; snprintf(buf, 32, "map%d", which + 1); // challenges Loadlevel(buf); } else Loadlevel("mapsave"); } void Game::Loadlevel(const char *name) { int templength; float lamefloat; static const char *pfx = ":Data:Maps:"; char *buf; float headprop,legprop,armprop,bodyprop; LOGFUNC; LOG(std::string("Loading level...") + name); if(!gameon) visibleloading=1; if(stealthloading) visibleloading=0; if(!stillloading) loadtime=0; gamestarted=1; numenvsounds=0; if(tutoriallevel!=-1) tutoriallevel=0; else tutoriallevel=1; if(tutoriallevel==1) tutorialstage=0; if(tutorialstage==0) { tutorialstagetime=0; tutorialmaxtime=1; } loadingstuff=1; pause_sound(whooshsound); pause_sound(stream_firesound); // Change the map filename into something that is os specific buf = (char*) alloca(strlen(pfx) + strlen(name) + 1); sprintf(buf, "%s%s", pfx, name); const char *FixedFN = ConvertFileName(buf); int mapvers; FILE *tfile; //~ char* buff=getcwd(NULL,0); //~ cout << buff << " " << FixedFN << endl; //~ free(buff); tfile=fopen( FixedFN, "rb" ); if(tfile) { pause_sound(stream_firesound); scoreadded=0; windialogue=false; hostiletime=0; won=0; animation[bounceidleanim].Load((char *)"Idle",middleheight,neutral); numdialogues=0; for(int i=0;i<20;i++) dialoguegonethrough[i]=0; indialogue=-1; cameramode=0; damagedealt=0; damagetaken=0; if(accountactive) difficulty=accountactive->getDifficulty(); if(difficulty!=2) minimap=1; else minimap=0; numhotspots=0; currenthotspot=-1; bonustime=1; skyboxtexture=1; skyboxr=1; skyboxg=1; skyboxb=1; freeze=0; winfreeze=0; for(int i=0;i<100;i++) bonusnum[i]=0; numfalls=0; numflipfail=0; numseen=0; numstaffattack=0; numswordattack=0; numknifeattack=0; numunarmedattack=0; numescaped=0; numflipped=0; numwallflipped=0; numthrowkill=0; numafterkill=0; numreversals=0; numattacks=0; maxalarmed=0; numresponded=0; bonustotal=startbonustotal; bonus=0; gameon=1; changedelay=0; if(console){ emit_sound_np(consolesuccesssound); freeze=0; console=false; } if(!stealthloading){ terrain.numdecals=0; Sprite::deleteSprites(); for(int i=0;i=15) funpackf(tfile, "Bi", &indemo); else indemo=0; if(mapvers>=5) funpackf(tfile, "Bi", &maptype); else maptype=mapkilleveryone; if(mapvers>=6) funpackf(tfile, "Bi", &hostile); else hostile=1; if(mapvers>=4) funpackf(tfile, "Bf Bf", &viewdistance, &fadestart); else{ viewdistance=100; fadestart=.6; } if(mapvers>=2) funpackf(tfile, "Bb Bf Bf Bf", &skyboxtexture, &skyboxr, &skyboxg, &skyboxb); else{ skyboxtexture=1; skyboxr=1; skyboxg=1; skyboxb=1; } if(mapvers>=10) funpackf(tfile, "Bf Bf Bf", &skyboxlightr, &skyboxlightg, &skyboxlightb); else{ skyboxlightr=skyboxr; skyboxlightg=skyboxg; skyboxlightb=skyboxb; } if(!stealthloading) funpackf(tfile, "Bf Bf Bf Bf Bf Bi", &player[0].coords.x,&player[0].coords.y,&player[0].coords.z,&player[0].rotation,&player[0].targetrotation, &player[0].num_weapons); if(stealthloading) funpackf(tfile, "Bf Bf Bf Bf Bf Bi", &lamefloat,&lamefloat,&lamefloat,&lamefloat,&lamefloat, &player[0].num_weapons); player[0].originalcoords=player[0].coords; if(player[0].num_weapons>0&&player[0].num_weapons<5) for(int j=0;j=9) funpackf(tfile, "Bi Bi", &player[0].whichskin, &player[0].creature); else{ player[0].whichskin=0; player[0].creature=rabbittype; } player[0].lastattack=-1; player[0].lastattack2=-1; player[0].lastattack3=-1; //dialogues if(mapvers>=8){ funpackf(tfile, "Bi", &numdialogues); for(int k=0;k128||templength<=0) templength=128; int m; for(m=0;m64||templength<=0)templength=64; for(m=0;m=7){ funpackf(tfile, "Bi", &numhotspots); for(int i=0;imaxdistance){ //~ whichclosest=i; maxdistance=tempdist; } } objects.radius=fast_sqrt(maxdistance); } if(visibleloading) LoadingScreen(); //mapcenter=objects.center; //mapradius=objects.radius; funpackf(tfile, "Bi", &numplayers); int howmanyremoved=0; bool removeanother=0; if(numplayers>1&&numplayers=5) funpackf(tfile, "Bi", &player[i-howmanyremoved].howactive); else player[i-howmanyremoved].howactive=typeactive; if(mapvers>=3) funpackf(tfile, "Bf",&player[i-howmanyremoved].scale); else player[i-howmanyremoved].scale=-1; if(mapvers>=11) funpackf(tfile, "Bb",&player[i-howmanyremoved].immobile); else player[i-howmanyremoved].immobile=0; if(mapvers>=12) funpackf(tfile, "Bf",&player[i-howmanyremoved].rotation); else player[i-howmanyremoved].rotation=0; player[i-howmanyremoved].targetrotation=player[i-howmanyremoved].rotation; if(player[i-howmanyremoved].num_weapons<0||player[i-howmanyremoved].num_weapons>5){ removeanother=1; howmanyremoved++; } if(!removeanother){ if(player[i-howmanyremoved].num_weapons>0&&player[i-howmanyremoved].num_weapons<5){ for(int j=0;j=5) funpackf(tfile, "Bi", &player[i-howmanyremoved].waypointtype[j]); else player[i-howmanyremoved].waypointtype[j] = wpkeepwalking; } funpackf(tfile, "Bi", &player[i-howmanyremoved].waypoint); if(player[i-howmanyremoved].waypoint>player[i-howmanyremoved].numwaypoints-1) player[i-howmanyremoved].waypoint=0; funpackf(tfile, "Bf Bf Bf", &player[i-howmanyremoved].armorhead, &player[i-howmanyremoved].armorhigh, &player[i-howmanyremoved].armorlow); funpackf(tfile, "Bf Bf Bf", &player[i-howmanyremoved].protectionhead, &player[i-howmanyremoved].protectionhigh, &player[i-howmanyremoved].protectionlow); funpackf(tfile, "Bf Bf Bf", &player[i-howmanyremoved].metalhead, &player[i-howmanyremoved].metalhigh, &player[i-howmanyremoved].metallow); funpackf(tfile, "Bf Bf", &player[i-howmanyremoved].power, &player[i-howmanyremoved].speedmult); if(mapvers>=4) funpackf(tfile, "Bf Bf Bf Bf", &headprop, &bodyprop, &armprop, &legprop); else{ headprop=1; bodyprop=1; armprop=1; legprop=1; } if(player[i-howmanyremoved].creature==wolftype){ player[i-howmanyremoved].proportionhead=1.1*headprop; player[i-howmanyremoved].proportionbody=1.1*bodyprop; player[i-howmanyremoved].proportionarms=1.1*armprop; player[i-howmanyremoved].proportionlegs=1.1*legprop; } if(player[i-howmanyremoved].creature==rabbittype){ player[i-howmanyremoved].proportionhead=1.2*headprop; player[i-howmanyremoved].proportionbody=1.05*bodyprop; player[i-howmanyremoved].proportionarms=1.00*armprop; player[i-howmanyremoved].proportionlegs=1.1*legprop; player[i-howmanyremoved].proportionlegs.y=1.05*legprop; } funpackf(tfile, "Bi", &player[i-howmanyremoved].numclothes); if(player[i-howmanyremoved].numclothes){ for(int k=0;k30||numpathpoints<0) numpathpoints=0; for(int j=0;jmaxplayers-1) numplayers=maxplayers-1; for(int i=0;itutorialmaxtime){ tutorialstage++; tutorialsuccess=0; if(tutorialstage<=1){ canattack=0; cananger=0; reversaltrain=0; } switch(tutorialstage){ case 1: tutorialmaxtime=5; break; case 2: tutorialmaxtime=2; break; case 3: tutorialmaxtime=600; break; case 4: tutorialmaxtime=1000; break; case 5: tutorialmaxtime=600; break; case 6: tutorialmaxtime=600; break; case 7: tutorialmaxtime=600; break; case 8: tutorialmaxtime=600; break; case 9: tutorialmaxtime=600; break; case 10: tutorialmaxtime=2; break; case 11: tutorialmaxtime=1000; break; case 12: tutorialmaxtime=1000; break; case 13: tutorialmaxtime=2; break; case 14: { tutorialmaxtime=3; XYZ temp,temp2; temp.x=1011; temp.y=84; temp.z=491; temp2.x=1025; temp2.y=75; temp2.z=447; player[1].coords=(temp+temp2)/2; emit_sound_at(fireendsound, player[1].coords); for(int i=0;i0)tutorialsuccess=1; break; case 41: if(player[0].weaponactive==-1&&player[0].num_weapons>0)tutorialsuccess=1; break; case 43: if(player[0].targetanimation==knifeslashstartanim)tutorialsuccess=1; break; case 44: if(animation[player[0].targetanimation].attack==reversal)tutorialsuccess=1; break; case 45: if(animation[player[0].targetanimation].attack==reversal)tutorialsuccess=1; break; case 46: if(animation[player[0].targetanimation].attack==reversal)tutorialsuccess=1; break; case 49: if(player[1].weaponstuck!=-1)tutorialsuccess=1; break; default: break; } if(tutorialsuccess>=1)tutorialstagetime=tutorialmaxtime-3; if(tutorialstagetime==tutorialmaxtime-3){ emit_sound_np(consolesuccesssound); } if(tutorialsuccess>=1){ if(tutorialstage==34||tutorialstage==35) tutorialstagetime=tutorialmaxtime-1; } } if(tutorialstage<14||tutorialstage>=50){ player[1].coords.y=300; player[1].velocity=0; } } void Game::doDebugKeys(){ float headprop,bodyprop,armprop,legprop; if(debugmode){ if(Input::isKeyPressed(SDLK_h)){ player[0].damagetolerance=200000; player[0].damage=0; player[0].burnt=0; player[0].permanentdamage=0; player[0].superpermanentdamage=0; } if(Input::isKeyPressed(SDLK_j)){ environment++; if(environment>2) environment=0; Setenvironment(environment); } if(Input::isKeyPressed(SDLK_c)){ cameramode=1-cameramode; } if(Input::isKeyPressed(SDLK_x)&&!Input::isKeyDown(SDLK_LSHIFT)){ if(player[0].num_weapons>0){ if(weapons[player[0].weaponids[0]].getType()==sword) weapons[player[0].weaponids[0]].setType(staff); else if(weapons[player[0].weaponids[0]].getType()==staff) weapons[player[0].weaponids[0]].setType(knife); else weapons[player[0].weaponids[0]].setType(sword); } } if(Input::isKeyPressed(SDLK_x)&&Input::isKeyDown(SDLK_LSHIFT)){ int closest=-1; float closestdist=-1; float distance; if(numplayers>1) for(int i=1;i1) for(int i=1;i1) for(int i=1;i9) player[closest].whichskin=0; if(player[closest].whichskin>2&&player[closest].creature==wolftype) player[closest].whichskin=0; LoadTextureSave(creatureskin[player[closest].creature][player[closest].whichskin], &player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); } if(player[closest].numclothes){ for(int i=0;i1) for(int i=1;i1) for(int i=1;i1) for(int i=1;inumchallengelevels-1) targetlevel=0; loading=1; leveltime=5; } if(editorenabled){ if(Input::isKeyPressed(SDLK_DELETE)&&Input::isKeyDown(SDLK_LSHIFT)){ int closest=-1; float closestdist=-1; float distance; if(numplayers>1) for(int i=1;i0&&closest>=0){ //player[closest]=player[numplayers-1]; //player[closest].skeleton=player[numplayers-1].skeleton; numplayers--; } } if(Input::isKeyPressed(SDLK_DELETE)&&Input::isKeyDown(SDLK_LCTRL)){ int closest=-1; float closestdist=-1; float distance; if(max_objects>1) for(int i=1;i0&&closest>=0){ objects.position[closest].y-=500; } } if(Input::isKeyPressed(SDLK_m)&&Input::isKeyDown(SDLK_LSHIFT)){ //drawmode++; //if(drawmode>2)drawmode=0; if(objects.numobjects1) for(int i=0;i1&&pathpointselected!=-1){ numpathpointconnect[pathpointselected]++; pathpointconnect[pathpointselected][numpathpointconnect[pathpointselected]-1]=numpathpoints-1; } pathpointselected=numpathpoints-1; } } } if(Input::isKeyPressed(SDLK_PERIOD)){ pathpointselected++; if(pathpointselected>=numpathpoints) pathpointselected=-1; } if(Input::isKeyPressed(SDLK_COMMA)&&!Input::isKeyDown(SDLK_LSHIFT)){ pathpointselected--; if(pathpointselected<=-2) pathpointselected=numpathpoints-1; } if(Input::isKeyPressed(SDLK_COMMA)&&Input::isKeyDown(SDLK_LSHIFT)){ if(pathpointselected!=-1){ numpathpoints--; pathpoint[pathpointselected]=pathpoint[numpathpoints]; numpathpointconnect[pathpointselected]=numpathpointconnect[numpathpoints]; for(int i=0;ifiretype)editortype=0; } if(Input::isKeyDown(SDLK_LEFT)&&!Input::isKeyDown(SDLK_LSHIFT)&&!Input::isKeyDown(SDLK_LCTRL)){ editorrotation-=multiplier*100; if(editorrotation<-.01)editorrotation=-.01; } if(Input::isKeyDown(SDLK_RIGHT)&&!Input::isKeyDown(SDLK_LSHIFT)&&!Input::isKeyDown(SDLK_LCTRL)){ editorrotation+=multiplier*100; } if(Input::isKeyDown(SDLK_UP)&&!Input::isKeyDown(SDLK_LCTRL)){ editorsize+=multiplier; } if(Input::isKeyDown(SDLK_DOWN)&&!Input::isKeyDown(SDLK_LCTRL)){ editorsize-=multiplier; if(editorsize<.1)editorsize=.1; } if(Input::isKeyPressed(SDLK_LEFT)&&Input::isKeyDown(SDLK_LSHIFT)&&Input::isKeyDown(SDLK_LCTRL)){ mapradius-=multiplier*10; } if(Input::isKeyPressed(SDLK_RIGHT)&&Input::isKeyDown(SDLK_LSHIFT)&&Input::isKeyDown(SDLK_LCTRL)){ mapradius+=multiplier*10; } if(Input::isKeyDown(SDLK_UP)&&Input::isKeyDown(SDLK_LCTRL)){ editorrotation2+=multiplier*100; } if(Input::isKeyDown(SDLK_DOWN)&&Input::isKeyDown(SDLK_LCTRL)){ editorrotation2-=multiplier*100; if(editorrotation2<-.01)editorrotation2=-.01; } if(Input::isKeyPressed(SDLK_DELETE)&&objects.numobjects&&Input::isKeyDown(SDLK_LSHIFT)){ int closest=-1; float closestdist=-1; float distance; for(int i=0;i0&&closest>=0)objects.DeleteObject(closest); } } } } void Game::doJumpReversals(){ for(int k=0;k0&& !player[k].skeleton.free&& player[k].targetanimation!=climbanim&& player[k].targetanimation!=hanganim){ XYZ lowpoint,lowpointtarget,lowpoint2,lowpointtarget2,lowpoint3,lowpointtarget3,lowpoint4,lowpointtarget4,lowpoint5,lowpointtarget5,lowpoint6,lowpointtarget6,lowpoint7,lowpointtarget7,colpoint,colpoint2; int whichhit; bool tempcollide=0; if(player[k].collide<-.3) player[k].collide=-.3; if(player[k].collide>1) player[k].collide=1; player[k].collide-=multiplier*30; //clip to terrain player[k].coords.y=max(player[k].coords.y, terrain.getHeight(player[k].coords.x,player[k].coords.z)); for(int l=0;l.5&&player[k].aitype==playercontrolled|| objects.position[i].y>player[k].coords.y){ lowpoint=player[k].coords; if(player[k].targetanimation!=jumpupanim&& player[k].targetanimation!=jumpdownanim&& !player[k].isFlip()) lowpoint.y+=1.25; else lowpoint.y+=1.3; if( player[k].coords.yterrain.getHeight(player[k].coords.x,player[k].coords.z)-.1) player[k].coords.y=terrain.getHeight(player[k].coords.x,player[k].coords.z); if(player[k].SphereCheck(&lowpoint, 1.3, &colpoint, &objects.position[i], &objects.rotation[i], &objects.model[i])!=-1){ flatfacing=lowpoint-player[k].coords; player[k].coords=lowpoint; player[k].coords.y-=1.3; player[k].collide=1; tempcollide=1; //wall jumps //TODO: refactor four similar blocks if(player[k].aitype==playercontrolled&& (player[k].targetanimation==jumpupanim|| player[k].targetanimation==jumpdownanim|| player[k].isFlip())&& !player[k].jumptogglekeydown&& player[k].jumpkeydown){ lowpointtarget=lowpoint+DoRotation(player[k].facing,0,-90,0)*1.5; XYZ tempcoords1=lowpoint; whichhit=objects.model[i].LineCheck(&lowpoint,&lowpointtarget,&colpoint,&objects.position[i],&objects.rotation[i]); if(whichhit!=-1&&fabs(objects.model[i].facenormals[whichhit].y)<.3){ player[k].setAnimation(walljumpleftanim); emit_sound_at(movewhooshsound, player[k].coords); if(k==0) pause_sound(whooshsound); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x)*180/M_PI; if(lowpointtarget.z<0) player[k].rotation=180-player[k].rotation; player[k].targetrotation=player[k].rotation; player[k].lowrotation=player[k].rotation; if(k==0) numwallflipped++; } else { lowpoint=tempcoords1; lowpointtarget=lowpoint+DoRotation(player[k].facing,0,90,0)*1.5; whichhit=objects.model[i].LineCheck(&lowpoint,&lowpointtarget,&colpoint,&objects.position[i],&objects.rotation[i]); if(whichhit!=-1&&fabs(objects.model[i].facenormals[whichhit].y)<.3){ player[k].setAnimation(walljumprightanim); emit_sound_at(movewhooshsound, player[k].coords); if(k==0)pause_sound(whooshsound); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x)*180/M_PI; if(lowpointtarget.z<0)player[k].rotation=180-player[k].rotation; player[k].targetrotation=player[k].rotation; player[k].lowrotation=player[k].rotation; if(k==0)numwallflipped++; } else { lowpoint=tempcoords1; lowpointtarget=lowpoint+player[k].facing*2; whichhit=objects.model[i].LineCheck(&lowpoint,&lowpointtarget,&colpoint,&objects.position[i],&objects.rotation[i]); if(whichhit!=-1&&fabs(objects.model[i].facenormals[whichhit].y)<.3){ player[k].setAnimation(walljumpbackanim); emit_sound_at(movewhooshsound, player[k].coords); if(k==0)pause_sound(whooshsound); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x)*180/M_PI; if(lowpointtarget.z<0)player[k].rotation=180-player[k].rotation; player[k].targetrotation=player[k].rotation; player[k].lowrotation=player[k].rotation; if(k==0)numwallflipped++; } else { lowpoint=tempcoords1; lowpointtarget=lowpoint-player[k].facing*2; whichhit=objects.model[i].LineCheck(&lowpoint,&lowpointtarget,&colpoint,&objects.position[i],&objects.rotation[i]); if(whichhit!=-1&&fabs(objects.model[i].facenormals[whichhit].y)<.3){ player[k].setAnimation(walljumpfrontanim); emit_sound_at(movewhooshsound, player[k].coords); if(k==0)pause_sound(whooshsound); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x)*180/M_PI; if(lowpointtarget.z<0)player[k].rotation=180-player[k].rotation; player[k].rotation+=180; player[k].targetrotation=player[k].rotation; player[k].lowrotation=player[k].rotation; if(k==0)numwallflipped++; } } } } } } } else if(objects.type[i]==rocktype){ lowpoint2=player[k].coords; lowpoint=player[k].coords; lowpoint.y+=2; if(objects.model[i].LineCheck(&lowpoint,&lowpoint2,&colpoint,&objects.position[i],&objects.rotation[i])!=-1){ player[k].coords=colpoint; player[k].collide=1; tempcollide=1; if(player[k].targetanimation==jumpdownanim||player[k].isFlip()){ //flipped into a rock if(player[k].isFlip()&&animation[player[k].targetanimation].label[player[k].targetframe]==7) player[k].RagDoll(0); if(player[k].targetanimation==jumpupanim){ player[k].jumppower=-4; player[k].targetanimation=player[k].getIdle(); } player[k].target=0; player[k].targetframe=0; player[k].onterrain=1; if(player[k].id==0){ pause_sound(whooshsound); OPENAL_SetVolume(channels[whooshsound], 0); } //landing if((player[k].targetanimation==jumpdownanim||player[k].isFlip())&&!player[k].wasLanding()){ if(player[k].isFlip()) player[k].jumppower=-4; player[k].targetanimation=player[k].getLanding(); emit_sound_at(landsound, player[k].coords, 128.); if(k==0){ envsound[numenvsounds]=player[k].coords; envsoundvol[numenvsounds]=16; envsoundlife[numenvsounds]=.4; numenvsounds++; } } } } } } if(tempcollide&&(/*player[k].jumptogglekeydown*/1==1||player[k].aitype!=playercontrolled)) for(int l=0;l.5) if(whichhit!=-1){ if(whichhit!=-1&&player[k].targetanimation!=jumpupanim&&player[k].targetanimation!=jumpdownanim) player[k].collided=1; if(checkcollide(lowpoint7,lowpointtarget7)==-1) if(checkcollide(lowpoint6,lowpointtarget6)==-1) if( objects.model[i].LineCheckPossible(&lowpoint2,&lowpointtarget2, &colpoint,&objects.position[i],&objects.rotation[i])!=-1&& objects.model[i].LineCheckPossible(&lowpoint3,&lowpointtarget3, &colpoint,&objects.position[i],&objects.rotation[i])!=-1&& objects.model[i].LineCheckPossible(&lowpoint4,&lowpointtarget4, &colpoint,&objects.position[i],&objects.rotation[i])!=-1&& objects.model[i].LineCheckPossible(&lowpoint5,&lowpointtarget5, &colpoint,&objects.position[i],&objects.rotation[i])!=-1) for(int j=0;j<45;j++){ lowpoint=player[k].coords; lowpoint.y+=(float)j/13; lowpointtarget=lowpoint+facing*1.4; if(objects.model[i].LineCheckPossible(&lowpoint,&lowpointtarget, &colpoint2,&objects.position[i],&objects.rotation[i])==-1){ if(j<=6||j<=25&&player[k].targetanimation==jumpdownanim) break; if(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim){ lowpoint=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[k],0); lowpoint=player[k].coords; lowpoint.y+=(float)j/13; lowpointtarget=lowpoint+facing*1.3; flatfacing=player[k].coords; player[k].coords=colpoint-DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[k],0)*.01; player[k].coords.y=lowpointtarget.y-.07; player[k].currentoffset=(flatfacing-player[k].coords)/player[k].scale; if(j>10||!player[k].isRun()){ if(player[k].targetanimation==jumpdownanim||player[k].targetanimation==jumpupanim){ if(k==0) pause_sound(whooshsound); } emit_sound_at(jumpsound, player[k].coords, 128.); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x)*180/M_PI; if(lowpointtarget.z<0) player[k].rotation=180-player[k].rotation; player[k].targetrotation=player[k].rotation; player[k].lowrotation=player[k].rotation; //player[k].velocity=lowpointtarget*.03; player[k].velocity=0; //climb ledge (?) if(player[k].targetanimation==jumpupanim){ player[k].targetanimation=climbanim; player[k].jumppower=0; player[k].jumpclimb=1; } player[k].transspeed=6; player[k].target=0; player[k].targetframe=1; //hang ledge (?) if(j>25){ player[k].setAnimation(hanganim); player[k].jumppower=0; } } break; } } } } } } } } if(player[k].collide<=0){ //in the air if(!player[k].onterrain&& player[k].targetanimation!=jumpupanim&& player[k].targetanimation!=jumpdownanim&& player[k].targetanimation!=climbanim&& player[k].targetanimation!=hanganim&& !player[k].isWallJump()&& !player[k].isFlip()){ if(player[k].currentanimation!=climbanim&& player[k].currentanimation!=tempanim&& player[k].targetanimation!=backhandspringanim&& (player[k].targetanimation!=rollanim|| player[k].targetframe<2|| player[k].targetframe>6)){ //stagger off ledge (?) if(player[k].targetanimation==staggerbackhighanim||player[k].targetanimation==staggerbackhardanim) player[k].RagDoll(0); player[k].setAnimation(jumpdownanim); if(!k) emit_sound_at(whooshsound, player[k].coords, 128.); } //gravity player[k].velocity.y+=gravity; } } } player[k].realoldcoords=player[k].coords; } } void Game::doAttacks(){ static XYZ relative; static int randattack; static bool playerrealattackkeydown=0; if(!Input::isKeyDown(attackkey)) oldattackkey=0; if(oldattackkey) player[0].attackkeydown=0; if(oldattackkey) playerrealattackkeydown=0; if(!oldattackkey) playerrealattackkeydown=Input::isKeyDown(attackkey); if((player[0].parriedrecently<=0|| player[0].weaponactive==-1)&& (!oldattackkey|| (realthreat&& player[0].lastattack!=swordslashanim&& player[0].lastattack!=knifeslashstartanim&& player[0].lastattack!=staffhitanim&& player[0].lastattack!=staffspinhitanim))) player[0].attackkeydown=Input::isKeyDown(attackkey); if(Input::isKeyDown(attackkey)&& !oldattackkey&& !player[0].backkeydown){ for(int k=0;k1) for(int i=0;i0&& attackweapon==knife&& player[i].bloodloss>player[i].damagetolerance/2) player[k].targetanimation=knifefollowanim; //knifeslashstart else if(distance<2.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height!=lowheight&& !player[k].forwardkeydown&& !player[k].leftkeydown&& !player[k].rightkeydown&& !player[k].crouchkeydown&& attackweapon==knife&& player[k].weaponmissdelay<=0) player[k].targetanimation=knifeslashstartanim; //swordslash else if(distance<4.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height!=lowheight&& !player[k].crouchkeydown&& attackweapon==sword&& player[k].weaponmissdelay<=0) player[k].targetanimation=swordslashanim; //staffhit else if(distance<4.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height!=lowheight&& !player[k].crouchkeydown&& attackweapon==staff&& player[k].weaponmissdelay<=0&& !player[k].leftkeydown&& !player[k].rightkeydown&& !player[k].forwardkeydown) player[k].targetanimation=staffhitanim; //staffspinhit else if(distance<4.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height!=lowheight&& !player[k].crouchkeydown&& attackweapon==staff&& player[k].weaponmissdelay<=0) player[k].targetanimation=staffspinhitanim; //spinkick else if(distance<2.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height!=lowheight) player[k].targetanimation=spinkickanim; //lowkick else if(distance<2.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height==lowheight&& animation[player[k].targetanimation].attack!=normalattack) player[k].targetanimation=lowkickanim; } else { //AI player if(distance<4.5*sq(player[k].scale*5)){ randattack=abs(Random()%5); if(!attackweapon&&distance<2.5*sq(player[k].scale*5)){ //sweep if(randattack==0&&animation[player[i].targetanimation].height!=lowheight) player[k].targetanimation=sweepanim; //upunch else if(randattack==1&&animation[player[i].targetanimation].height!=lowheight&& !attackweapon) player[k].targetanimation=upunchanim; //spinkick else if(randattack==2&&animation[player[i].targetanimation].height!=lowheight) player[k].targetanimation=spinkickanim; //lowkick else if(animation[player[i].targetanimation].height==lowheight) player[k].targetanimation=lowkickanim; } if(attackweapon){ //sweep if((tutoriallevel!=1||!attackweapon)&& distance<2.5*sq(player[k].scale*5)&& randattack==0&& animation[player[i].targetanimation].height!=lowheight) player[k].targetanimation=sweepanim; //knifeslashstart else if(distance<2.5*sq(player[k].scale*5)&& attackweapon==knife&& player[k].weaponmissdelay<=0) player[k].targetanimation=knifeslashstartanim; //swordslash else if(!(player[0].victim==&player[i]&& player[0].hasvictim&& player[0].targetanimation==swordslashanim)&& attackweapon==sword&& player[k].weaponmissdelay<=0) player[k].targetanimation=swordslashanim; //staffhit else if(!(player[0].victim==&player[i]&& player[0].hasvictim&& player[0].targetanimation==swordslashanim)&& attackweapon==staff&& player[k].weaponmissdelay<=0&& randattack<3) player[k].targetanimation=staffhitanim; //staffspinhit else if(!(player[0].victim==&player[i]&& player[0].hasvictim&& player[0].targetanimation==swordslashanim)&& attackweapon==staff&& player[k].weaponmissdelay<=0&& randattack>=3) player[k].targetanimation=staffspinhitanim; //spinkick else if((tutoriallevel!=1||!attackweapon)&& distance<2.5*sq(player[k].scale*5)&& randattack==1&& animation[player[i].targetanimation].height!=lowheight) player[k].targetanimation=spinkickanim; //lowkick else if(distance<2.5*sq(player[k].scale*5)&& animation[player[i].targetanimation].height==lowheight&& animation[player[k].targetanimation].attack!=normalattack) player[k].targetanimation=lowkickanim; } } } //upunch becomes wolfslap if(player[k].targetanimation==upunchanim&&player[k].creature==wolftype) player[k].targetanimation=wolfslapanim; } //sneak attacks if((k==0)&&(tutoriallevel!=1||tutorialstage==22)&& player[i].howactive0&&player[k].madskills|| player[i].surprised>0|| player[i].aitype==passivetype|| attackweapon&&player[i].stunned>0)&& normaldotproduct(player[i].facing,player[i].coords-player[k].coords)>0){ //sneakattack if(!attackweapon){ player[k].currentanimation=sneakattackanim; player[k].targetanimation=sneakattackanim; player[i].currentanimation=sneakattackedanim; player[i].targetanimation=sneakattackedanim; player[k].oldcoords=player[k].coords; player[k].coords=player[i].coords; } //knifesneakattack if(attackweapon==knife){ player[k].currentanimation=knifesneakattackanim; player[k].targetanimation=knifesneakattackanim; player[i].currentanimation=knifesneakattackedanim; player[i].targetanimation=knifesneakattackedanim; player[i].oldcoords=player[i].coords; player[i].coords=player[k].coords; } //swordsneakattack if(attackweapon==sword){ player[k].currentanimation=swordsneakattackanim; player[k].targetanimation=swordsneakattackanim; player[i].currentanimation=swordsneakattackedanim; player[i].targetanimation=swordsneakattackedanim; player[i].oldcoords=player[i].coords; player[i].coords=player[k].coords; } if(attackweapon!=staff){ player[k].victim=&player[i]; player[k].hasvictim=1; player[i].targettilt2=0; player[i].targetframe=1; player[i].currentframe=0; player[i].target=0; player[i].velocity=0; player[k].targettilt2=player[i].targettilt2; player[k].currentframe=player[i].currentframe; player[k].targetframe=player[i].targetframe; player[k].target=player[i].target; player[k].velocity=0; player[k].targetrotation=player[i].rotation; player[k].rotation=player[i].rotation; player[i].targetrotation=player[i].rotation; } } if(animation[player[k].targetanimation].attack==normalattack&& player[k].victim==&player[i]&& (!player[i].skeleton.free)){ oldattackkey=1; player[k].targetframe=0; player[k].target=0; player[k].targetrotation=roughDirectionTo(player[k].coords,player[i].coords); player[k].targettilt2=pitchTo(player[k].coords,player[i].coords); player[k].lastattack3=player[k].lastattack2; player[k].lastattack2=player[k].lastattack; player[k].lastattack=player[k].targetanimation; } if(player[k].targetanimation==knifefollowanim&& player[k].victim==&player[i]){ oldattackkey=1; player[k].targetrotation=roughDirectionTo(player[k].coords,player[i].coords); player[k].targettilt2=pitchTo(player[k].coords,player[i].coords); player[k].victim=&player[i]; player[k].hasvictim=1; player[i].targetanimation=knifefollowedanim; player[i].currentanimation=knifefollowedanim; player[i].targettilt2=0; player[i].targettilt2=player[k].targettilt2; player[i].targetframe=1; player[i].currentframe=0; player[i].target=0; player[i].velocity=0; player[k].currentanimation=knifefollowanim; player[k].targetanimation=knifefollowanim; player[k].targettilt2=player[i].targettilt2; player[k].currentframe=player[i].currentframe; player[k].targetframe=player[i].targetframe; player[k].target=player[i].target; player[k].velocity=0; player[k].oldcoords=player[k].coords; player[i].coords=player[k].coords; player[i].targetrotation=player[k].targetrotation; player[i].rotation=player[k].targetrotation; player[k].rotation=player[k].targetrotation; player[i].rotation=player[k].targetrotation; } } } const bool hasstaff=attackweapon==staff; if(k==0&&numplayers>1) for(int i=0;i1000|| player[k].isRun()|| hasstaff|| (attackweapon&& (player[i].skeleton.longdead>2000|| player[i].damage>player[i].damagetolerance/8|| player[i].bloodloss>player[i].damagetolerance/2)&& distance<1.5*sq(player[k].scale*5)))){ player[k].victim=&player[i]; player[k].hasvictim=1; if(attackweapon&&tutoriallevel!=1){ //crouchstab if(player[k].crouchkeydown&&attackweapon==knife&&distance<1.5*sq(player[k].scale*5)) player[k].targetanimation=crouchstabanim; //swordgroundstab if(player[k].crouchkeydown&&distance<1.5*sq(player[k].scale*5)&&attackweapon==sword) player[k].targetanimation=swordgroundstabanim; //staffgroundsmash if(distance<3.5*sq(player[k].scale*5)&&attackweapon==staff) player[k].targetanimation=staffgroundsmashanim; } if(distance<2.5&& player[k].crouchkeydown&& player[k].targetanimation!=crouchstabanim&& !attackweapon&& player[i].dead&& player[i].skeleton.free&& player[i].skeleton.longdead>1000){ player[k].targetanimation=killanim; //TODO: refactor this out, what does it do? for(int j=0;jcoords)) player[k].victim=&player[i]; }else{ player[k].victim=&player[i]; player[k].hasvictim=1; } } } } if(player[k].aitype==playercontrolled) //rabbit kick if(player[k].attackkeydown&& player[k].isRun()&& player[k].wasRun()&& ((player[k].hasvictim&& findDistancefast(&player[k].coords,&player[k].victim->coords)<12*sq(player[k].scale*5)&& findDistancefast(&player[k].coords,&player[k].victim->coords)>7*sq(player[k].scale*5)&& !player[k].victim->skeleton.free&& player[k].victim->targetanimation!=getupfrombackanim&& player[k].victim->targetanimation!=getupfromfrontanim&& animation[player[k].victim->targetanimation].height!=lowheight&& player[k].aitype!=playercontrolled&& //wat??? normaldotproduct(player[k].facing,player[k].victim->coords-player[k].coords)>0&& player[k].rabbitkickenabled)|| player[k].jumpkeydown)){ oldattackkey=1; player[k].setAnimation(rabbitkickanim); } //update counts if(animation[player[k].targetanimation].attack&&k==0){ numattacks++; switch(attackweapon){ case 0: numunarmedattack++; break; case knife: numknifeattack++; break; case sword: numswordattack++; break; case staff: numstaffattack++; break; } } } } } } } void Game::doPlayerCollisions(){ static XYZ rotatetarget; static float collisionradius; if(numplayers>1) for(int k=0;kplayer[k].coords.y-3) if(player[i].coords.yplayer[k].coords.x-3) if(player[i].coords.xplayer[k].coords.z-3) if(player[i].coords.zskeleton.free) collisionradius=3; if((!player[i].skeleton.oldfree||!player[k].skeleton.oldfree)&& (findDistancefast(&tempcoords1,&tempcoords2)1)|| (player[k].skeleton.oldfree==1&&findLengthfast(&player[k].velocity)>1)|| (player[i].skeleton.oldfree==0&&player[k].skeleton.oldfree==0)){ rotatetarget=player[k].velocity-player[i].velocity; if((player[i].targetanimation!=getupfrombackanim&&player[i].targetanimation!=getupfromfrontanim|| player[i].skeleton.free)&& (player[k].targetanimation!=getupfrombackanim&&player[k].targetanimation!=getupfromfrontanim|| player[k].skeleton.free)) if((((k!=0&&findLengthfast(&rotatetarget)>150|| k==0&&findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll)&& normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&& (k==0|| k!=0&&player[i].skeleton.oldfree==1&&animation[player[k].currentanimation].attack==neutral|| /*i!=0&&*/player[k].skeleton.oldfree==1&&animation[player[i].currentanimation].attack==neutral))|| (player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&& (player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&& k==0&&!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree){ //If hit by body if( (i!=0||player[i].skeleton.free)&& (k!=0||player[k].skeleton.free)|| (animation[player[i].targetanimation].height==highheight&& animation[player[k].targetanimation].height==highheight)){ if(tutoriallevel!=1){ emit_sound_at(heavyimpactsound, player[i].coords); } player[i].RagDoll(0); if(player[i].damage>player[i].damagetolerance-findLengthfast(&rotatetarget)/4&&!player[i].dead){ award_bonus(0, aimbonus); } player[i].DoDamage(findLengthfast(&rotatetarget)/4); player[k].RagDoll(0); if(player[k].damage>player[k].damagetolerance-findLengthfast(&rotatetarget)/4&&!player[k].dead){ award_bonus(0, aimbonus); // Huh, again? } player[k].DoDamage(findLengthfast(&rotatetarget)/4); for(int j=0;jplayer[i].coords.y+2&& !player[0].onterrain) player[i].pause=1; //pathfinding if(player[i].aitype==pathfindtype){ if(player[i].finalpathfindpoint==-1){ float closestdistance; float tempdist; int closest; XYZ colpoint; closest=-1; closestdistance=-1; for(int j=0;j.8 && !player[i].jumpkeydown && player[i].collided<.8) player[i].targetrotation+=90*(player[i].whichdirection*2-1); if(player[i].collided<1||player[i].targetanimation!=jumpupanim) player[i].jumpkeydown=0; if((player[i].collided>.8&&player[i].jumppower>=5)) player[i].jumpkeydown=1; if((tutoriallevel!=1||cananger)&& hostile&& !player[0].dead&& findDistancefast(&player[i].coords,&player[0].coords)<400&& player[i].occluded<25){ if(findDistancefast(&player[i].coords,&player[0].coords)<12&& animation[player[0].targetanimation].height!=lowheight&& !editorenabled&& (player[0].coords.y0) if(player[j].coords.y.5) player[i].howactive=typeactive; if(player[i].aitype==passivetype){ player[i].aiupdatedelay-=multiplier; player[i].losupdatedelay-=multiplier; player[i].lastseentime+=multiplier; player[i].pausetime-=multiplier; if(player[i].lastseentime>1) player[i].lastseentime=1; if(player[i].aiupdatedelay<0){ if(player[i].numwaypoints>1&&player[i].howactive==typeactive&&player[i].pausetime<=0){ player[i].targetrotation=roughDirectionTo(player[i].coords,player[i].waypoints[player[i].waypoint]); player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.05; if(findDistancefastflat(&player[i].coords,&player[i].waypoints[player[i].waypoint])<1){ if(player[i].waypointtype[player[i].waypoint]==wppause) player[i].pausetime=4; player[i].waypoint++; if(player[i].waypoint>player[i].numwaypoints-1) player[i].waypoint=0; } } if(player[i].numwaypoints>1&&player[i].howactive==typeactive&&player[i].pausetime<=0) player[i].forwardkeydown=1; else player[i].forwardkeydown=0; player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].crouchkeydown=0; player[i].attackkeydown=0; player[i].throwkeydown=0; if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8){ if(!player[i].avoidsomething) player[i].targetrotation+=90*(player[i].whichdirection*2-1); else{ XYZ leftpos,rightpos; float leftdist,rightdist; leftpos = player[i].coords+DoRotation(player[i].facing,0,90,0); rightpos = player[i].coords-DoRotation(player[i].facing,0,90,0); leftdist = findDistancefast(&leftpos, &player[i].avoidwhere); rightdist = findDistancefast(&rightpos, &player[i].avoidwhere); if(leftdist.8&&player[i].jumppower>=5)) player[i].jumpkeydown=1; //hearing sounds if(!editorenabled){ if(player[i].howactive<=typesleeping) if(numenvsounds>0&&(tutoriallevel!=1||cananger)&&hostile) for(int j=0;j0&&findDistancefast(&player[i].coords,&envsound[j])< 2*(vol+vol*(player[i].creature==rabbittype)*3)) player[i].aitype=attacktypecutoff; } if(player[i].aitype!=passivetype){ if(player[i].howactive==typesleeping) player[i].setAnimation(getupfromfrontanim); player[i].howactive=typeactive; } } if(player[i].howactive0)){ float smelldistance=50; if(j==0&&player[j].num_weapons>0){ if(weapons[player[j].weaponids[0]].bloody) smelldistance=100; if(player[j].num_weapons==2) if(weapons[player[j].weaponids[1]].bloody) smelldistance=100; } if(j!=0) smelldistance=100; windsmell=windvector; Normalise(&windsmell); windsmell=windsmell*2+player[j].coords; if(findDistancefast(&player[i].coords,&windsmell)0) if((-1==checkcollide( DoRotation(player[i].getJointFor(head).position,0,player[i].rotation,0)* player[i].scale+player[i].coords, DoRotation(player[j].getJointFor(head).position,0,player[j].rotation,0)* player[j].scale+player[j].coords)&& !player[j].isWallJump())|| (player[j].targetanimation==hanganim&& normaldotproduct(player[j].facing,player[i].coords-player[j].coords)<0)){ player[i].lastseentime-=.2; if(j==0&&animation[player[j].targetanimation].height==lowheight) player[i].lastseentime-=.4; else player[i].lastseentime-=.6; } if(player[i].lastseentime<=0){ player[i].aitype=searchtype; player[i].lastchecktime=12; player[i].lastseen=player[j].coords; player[i].lastseentime=12; } } } } } //alerted surprise if(player[i].aitype==attacktypecutoff&&musictype!=2){ if(player[i].creature!=wolftype){ player[i].stunned=.6; player[i].surprised=.6; } if(player[i].creature==wolftype){ player[i].stunned=.47; player[i].surprised=.47; } numseen++; } } //search for player int j; if(player[i].aitype==searchtype){ player[i].aiupdatedelay-=multiplier; player[i].losupdatedelay-=multiplier; if(!player[i].pause) player[i].lastseentime-=multiplier; player[i].lastchecktime-=multiplier; if(player[i].isRun()&&!player[i].onground){ if(player[i].coords.y>terrain.getHeight(player[i].coords.x,player[i].coords.z)+10){ XYZ test2=player[i].coords+player[i].facing; test2.y+=5; XYZ test=player[i].coords+player[i].facing; test.y-=10; j=checkcollide(test2,test,player[i].laststanding); if(j==-1) j=checkcollide(test2,test); if(j==-1){ player[i].velocity=0; player[i].setAnimation(player[i].getStop()); player[i].targetrotation+=180; player[i].stunned=.5; //player[i].aitype=passivetype; player[i].aitype=pathfindtype; player[i].finalfinaltarget=player[i].waypoints[player[i].waypoint]; player[i].finalpathfindpoint=-1; player[i].targetpathfindpoint=-1; player[i].lastpathfindpoint=-1; player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; } else player[i].laststanding=j; } } //check out last seen location if(player[i].aiupdatedelay<0){ player[i].targetrotation=roughDirectionTo(player[i].coords,player[i].lastseen); player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.05; player[i].forwardkeydown=1; if(findDistancefastflat(&player[i].coords,&player[i].lastseen)<1*sq(player[i].scale*5)||player[i].lastchecktime<0){ player[i].forwardkeydown=0; player[i].aiupdatedelay=1; player[i].lastseen.x+=(float(Random()%100)-50)/25; player[i].lastseen.z+=(float(Random()%100)-50)/25; player[i].lastchecktime=3; } player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].crouchkeydown=0; player[i].attackkeydown=0; player[i].throwkeydown=0; if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8){ if(!player[i].avoidsomething)player[i].targetrotation+=90*(player[i].whichdirection*2-1); else{ XYZ leftpos,rightpos; float leftdist,rightdist; leftpos = player[i].coords+DoRotation(player[i].facing,0,90,0); rightpos = player[i].coords-DoRotation(player[i].facing,0,90,0); leftdist = findDistancefast(&leftpos, &player[i].avoidwhere); rightdist = findDistancefast(&rightpos, &player[i].avoidwhere); if(leftdist.8&&player[i].jumppower>=5)) player[i].jumpkeydown=1; if(numenvsounds>0&&((tutoriallevel!=1||cananger)&&hostile)) for(int k=0;k0) if((checkcollide( DoRotation(player[i].getJointFor(head).position,0,player[i].rotation,0)* player[i].scale+player[i].coords, DoRotation(player[0].getJointFor(head).position,0,player[0].rotation,0)* player[0].scale+player[0].coords)==-1)|| (player[0].targetanimation==hanganim&&normaldotproduct( player[0].facing,player[i].coords-player[0].coords)<0)){ /* //TODO: changed j to 0 on a whim, make sure this is correct (player[j].targetanimation==hanganim&&normaldotproduct( player[j].facing,player[i].coords-player[j].coords)<0) */ player[i].aitype=attacktypecutoff; player[i].lastseentime=1; } } //player escaped if(player[i].lastseentime<0){ //player[i].aitype=passivetype; numescaped++; player[i].aitype=pathfindtype; player[i].finalfinaltarget=player[i].waypoints[player[i].waypoint]; player[i].finalpathfindpoint=-1; player[i].targetpathfindpoint=-1; player[i].lastpathfindpoint=-1; player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; } } if(player[i].aitype!=gethelptype) player[i].runninghowlong=0; //get help from buddies if(player[i].aitype==gethelptype) { player[i].runninghowlong+=multiplier; player[i].aiupdatedelay-=multiplier; if(player[i].aiupdatedelay<0||player[i].ally==0) { player[i].aiupdatedelay=.2; //find closest ally //TODO: factor out closest search somehow if(!player[i].ally) { int closest=-1; float closestdist=-1; for(int k=0;k0){ player[i].targetrotation=roughDirectionTo(player[i].coords,player[player[i].ally].coords); player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.05; player[i].forwardkeydown=1; if(findDistancefastflat(&player[i].coords,&player[player[i].ally].coords)<3){ player[i].aitype=searchtype; player[i].lastseentime=12; player[player[i].ally].aitype=searchtype; if(player[player[i].ally].lastseentime.8&&!player[i].jumpkeydown&&player[i].collided<.8){ if(!player[i].avoidsomething) player[i].targetrotation+=90*(player[i].whichdirection*2-1); else{ XYZ leftpos,rightpos; float leftdist,rightdist; leftpos = player[i].coords+DoRotation(player[i].facing,0,90,0); rightpos = player[i].coords-DoRotation(player[i].facing,0,90,0); leftdist = findDistancefast(&leftpos, &player[i].avoidwhere); rightdist = findDistancefast(&rightpos, &player[i].avoidwhere); if(leftdist.8&&player[i].jumppower>=5) player[i].jumpkeydown=1; } //retreiving a weapon on the ground if(player[i].aitype==getweapontype){ player[i].aiupdatedelay-=multiplier; player[i].lastchecktime-=multiplier; if(player[i].aiupdatedelay<0){ player[i].aiupdatedelay=.2; //ALLY IS WEPON if(player[i].ally<0){ int closest=-1; float closestdist=-1; for(int k=0;k=0){ if(weapons[player[i].ally].owner!=-1|| findDistancefast(&player[i].coords,&weapons[player[i].ally].position)>16){ player[i].aitype=attacktypecutoff; player[i].lastseentime=1; } //TODO: factor these out as moveToward() player[i].targetrotation=roughDirectionTo(player[i].coords,weapons[player[i].ally].position); player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.05; player[i].forwardkeydown=1; if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8){ if(!player[i].avoidsomething) player[i].targetrotation+=90*(player[i].whichdirection*2-1); else{ XYZ leftpos,rightpos; float leftdist,rightdist; leftpos = player[i].coords+DoRotation(player[i].facing,0,90,0); rightpos = player[i].coords-DoRotation(player[i].facing,0,90,0); leftdist = findDistancefast(&leftpos, &player[i].avoidwhere); rightdist = findDistancefast(&rightpos, &player[i].avoidwhere); if(leftdist.8&&player[i].jumppower>=5)) player[i].jumpkeydown=1; } if(player[i].aitype==attacktypecutoff){ player[i].aiupdatedelay-=multiplier; //dodge or reverse rabbit kicks, knife throws, flips if(player[i].damage.5) player[i].stunned=1; } //go for weapon on the ground if(player[i].wentforweapon<3) for(int k=0;kterrain.getHeight(player[i].coords.x,player[i].coords.z)+10){ XYZ test2=player[i].coords+player[i].facing; test2.y+=5; XYZ test=player[i].coords+player[i].facing; test.y-=10; j=checkcollide(test2,test,player[i].laststanding); if(j==-1) j=checkcollide(test2,test); if(j==-1) { player[i].velocity=0; player[i].setAnimation(player[i].getStop()); player[i].targetrotation+=180; player[i].stunned=.5; player[i].aitype=pathfindtype; player[i].finalfinaltarget=player[i].waypoints[player[i].waypoint]; player[i].finalpathfindpoint=-1; player[i].targetpathfindpoint=-1; player[i].lastpathfindpoint=-1; player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; } else player[i].laststanding=j; } //lose sight of player in the air (?) if(player[0].coords.y>player[i].coords.y+5&& animation[player[0].targetanimation].height!=highheight&& !player[0].onterrain){ player[i].aitype=pathfindtype; player[i].finalfinaltarget=player[i].waypoints[player[i].waypoint]; player[i].finalpathfindpoint=-1; player[i].targetpathfindpoint=-1; player[i].lastpathfindpoint=-1; player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; } //it's time to think (?) if(player[i].aiupdatedelay<0&& !animation[player[i].targetanimation].attack&& player[i].targetanimation!=staggerbackhighanim&& player[i].targetanimation!=staggerbackhardanim&& player[i].targetanimation!=backhandspringanim&& player[i].targetanimation!=dodgebackanim){ //draw weapon if(player[i].weaponactive==-1&&player[i].num_weapons>0) player[i].drawkeydown=Random()%2; else player[i].drawkeydown=0; player[i].rabbitkickenabled=Random()%2; //chase player XYZ rotatetarget=player[0].coords+player[0].velocity; XYZ targetpoint=player[0].coords; if(findDistancefast(&player[0].coords,&player[i].coords)< findDistancefast(&rotatetarget,&player[i].coords)) targetpoint+=player[0].velocity* findDistance(&player[0].coords,&player[i].coords)/findLength(&player[i].velocity); player[i].targetrotation=roughDirectionTo(player[i].coords,targetpoint); player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.2+fabs((float)(Random()%100)/1000); if(findDistancefast(&player[i].coords,&player[0].coords)>5&&(player[0].weaponactive==-1||player[i].weaponactive!=-1)) player[i].forwardkeydown=1; else if((findDistancefast(&player[i].coords,&player[0].coords)>16|| findDistancefast(&player[i].coords,&player[0].coords)<9)&& player[0].weaponactive!=-1) player[i].forwardkeydown=1; else if(Random()%6==0||(player[i].creature==wolftype&&Random()%3==0)) player[i].forwardkeydown=1; else player[i].forwardkeydown=0; //chill out around the corpse if(player[0].dead){ player[i].forwardkeydown=0; if(Random()%10==0) player[i].forwardkeydown=1; if(Random()%100==0){ player[i].aitype=pathfindtype; player[i].finalfinaltarget=player[i].waypoints[player[i].waypoint]; player[i].finalpathfindpoint=-1; player[i].targetpathfindpoint=-1; player[i].lastpathfindpoint=-1; player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; } } player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].crouchkeydown=0; player[i].throwkeydown=0; if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8) player[i].targetrotation+=90*(player[i].whichdirection*2-1); //attack!!! if(Random()%2==0||player[i].weaponactive!=-1||player[i].creature==wolftype) player[i].attackkeydown=1; else player[i].attackkeydown=0; if(player[i].isRun()&&Random()%6&&findDistancefast(&player[i].coords,&player[0].coords)>7) player[i].attackkeydown=0; //TODO: wat if(player[i].aitype!=playercontrolled&& (player[i].isIdle()|| player[i].isCrouch()|| player[i].isRun())){ int target=-2; for(int j=0;jcoords)<4&& player[j].victim==&player[i]&& (player[j].targetanimation==sweepanim|| player[j].targetanimation==spinkickanim|| player[j].targetanimation==staffhitanim|| player[j].targetanimation==staffspinhitanim|| player[j].targetanimation==winduppunchanim|| player[j].targetanimation==upunchanim|| player[j].targetanimation==wolfslapanim|| player[j].targetanimation==knifeslashstartanim|| player[j].targetanimation==swordslashanim&& (findDistancefast(&player[j].coords,&player[i].coords)<2|| player[i].weaponactive!=-1))){ if(target>=0) target=-1; else target=j; } if(target>=0) player[target].Reverse(); } if(player[i].collided<1) player[i].jumpkeydown=0; if(player[i].collided>.8&&player[i].jumppower>=5|| findDistancefast(&player[i].coords,&player[0].coords)>400&& player[i].onterrain&& player[i].creature==rabbittype) player[i].jumpkeydown=1; //TODO: why are we controlling the human? if(normaldotproduct(player[i].facing,player[0].coords-player[i].coords)>0) player[0].jumpkeydown=0; if(player[0].targetanimation==jumpdownanim&& findDistancefast(&player[0].coords,&player[i].coords)<40) player[i].crouchkeydown=1; if(player[i].jumpkeydown) player[i].attackkeydown=0; if(tutoriallevel==1) if(!canattack) player[i].attackkeydown=0; XYZ facing=player[i].coords; XYZ flatfacing=player[0].coords; facing.y+=player[i].getJointFor(head).position.y*player[i].scale; flatfacing.y+=player[0].getJointFor(head).position.y*player[0].scale; if(player[i].occluded>=2) if(-1!=checkcollide(facing,flatfacing)){ if(!player[i].pause) player[i].lastseentime-=.2; if(player[i].lastseentime<=0&& (player[i].creature!=wolftype|| player[i].weaponstuck==-1)){ player[i].aitype=searchtype; player[i].lastchecktime=12; player[i].lastseen=player[0].coords; player[i].lastseentime=12; } }else player[i].lastseentime=1; } } if(animation[player[0].targetanimation].height==highheight&& (player[i].aitype==attacktypecutoff|| player[i].aitype==searchtype)) if(player[0].coords.y>terrain.getHeight(player[0].coords.x,player[0].coords.z)+10){ XYZ test=player[0].coords; test.y-=40; if(-1==checkcollide(player[0].coords,test)) player[i].stunned=1; } //stunned if(player[i].aitype==passivetype&&!(player[i].numwaypoints>1)|| player[i].stunned>0|| player[i].pause&&player[i].damage>player[i].superpermanentdamage){ if(player[i].pause) player[i].lastseentime=1; player[i].targetrotation=player[i].rotation; player[i].forwardkeydown=0; player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].jumpkeydown=0; player[i].attackkeydown=0; player[i].crouchkeydown=0; player[i].throwkeydown=0; } XYZ facing; facing=0; facing.z=-1; XYZ flatfacing=DoRotation(facing,0,player[i].rotation+180,0); facing=flatfacing; if(player[i].aitype==attacktypecutoff){ player[i].targetheadrotation=180-roughDirectionTo(player[i].coords,player[0].coords); player[i].targetheadrotation2=pitchTo(player[i].coords,player[0].coords); }else if(player[i].howactive>=typesleeping){ player[i].targetheadrotation=player[i].targetrotation; player[i].targetheadrotation2=0; }else{ if(player[i].interestdelay<=0){ player[i].interestdelay=.7+(float)(abs(Random()%100))/100; player[i].headtarget=player[i].coords; player[i].headtarget.x+=(float)(abs(Random()%200)-100)/100; player[i].headtarget.z+=(float)(abs(Random()%200)-100)/100; player[i].headtarget.y+=(float)(abs(Random()%200)-100)/300; player[i].headtarget+=player[i].facing*1.5; } player[i].targetheadrotation=180-roughDirectionTo(player[i].coords,player[i].headtarget); player[i].targetheadrotation2=pitchTo(player[i].coords,player[i].headtarget); } } } /* Values of mainmenu : 1 Main menu 2 Menu pause (resume/end game) 3 Option menu 4 Controls configuration menu 5 Main game menu (choose level or challenge) 6 Deleting user menu 7 User managment menu (select/add) 8 Choose difficulty menu 9 Challenge level selection menu 10 End of the campaign congratulation (is that really a menu?) 11 Same that 9 ??? => unused 18 stereo configuration */ void Game::MenuTick(){ //menu buttons // some specific case where we do something even if the left mouse button is not pressed. if((mainmenu==5) && (endgame==2)) { accountactive->endGame(); endgame=0; } if(mainmenu==10) endgame=2; if( (mainmenu==18) && Input::isKeyPressed(MOUSEBUTTON2) && (selected==1) ) stereoseparation-=0.001; if(Input::MouseClicked() && (selected >= 0)) { // handling of the left mouse clic in menus switch(mainmenu) { case 1: case 2: switch(selected) { case 1: if(gameon) { //resume mainmenu=0; pause_sound(stream_menutheme); resume_stream(leveltheme); } else { //new game fireSound(firestartsound); flash(); mainmenu=(accountactive?5:7); selected=-1; } break; case 2: //options fireSound(); flash(); mainmenu=3; if(newdetail>2) newdetail=detail; if(newdetail<0) newdetail=detail; if(newscreenwidth>3000) newscreenwidth=screenwidth; if(newscreenwidth<0) newscreenwidth=screenwidth; if(newscreenheight>3000) newscreenheight=screenheight; if(newscreenheight<0) newscreenheight=screenheight; break; case 3: fireSound(); flash(); if(gameon){ //end game gameon=0; mainmenu=1; } else { //quit tryquit=1; pause_sound(stream_menutheme); } break; } break; case 3: fireSound(); bool isCustomResolution,found; switch(selected){ case 0: extern SDL_Rect **resolutions; isCustomResolution = true; found = false; for(int i = 0; (!found) && (resolutions[i]); i++) { if((resolutions[i]->w == screenwidth) && (resolutions[i]->h == screenwidth)) isCustomResolution = false; if((resolutions[i]->w == newscreenwidth) && (resolutions[i]->h == newscreenheight)) { i++; if(resolutions[i] != NULL) { newscreenwidth = (int) resolutions[i]->w; newscreenheight = (int) resolutions[i]->h; } else if(isCustomResolution){ if((screenwidth == newscreenwidth) && (screenheight == newscreenheight)) { newscreenwidth = (int) resolutions[0]->w; newscreenheight = (int) resolutions[0]->h; } else { newscreenwidth = screenwidth; newscreenheight = screenheight; } } else { newscreenwidth = (int) resolutions[0]->w; newscreenheight = (int) resolutions[0]->h; } found = true; } } if(!found) { newscreenwidth = (int) resolutions[0]->w; newscreenheight = (int) resolutions[0]->h; } break; case 1: newdetail++; if(newdetail>2) newdetail=0; break; case 2: bloodtoggle++; if(bloodtoggle>2) bloodtoggle=0; break; case 3: difficulty++; if(difficulty>2) difficulty=0; break; case 4: ismotionblur = !ismotionblur; break; case 5: decals = !decals; break; case 6: musictoggle = !musictoggle; if(musictoggle) { emit_stream_np(stream_menutheme); } else { pause_sound(leveltheme); pause_sound(stream_fighttheme); pause_sound(stream_menutheme); for(int i=0;i<4;i++){ oldmusicvolume[i]=0; musicvolume[i]=0; } } break; case 7: // controls flash(); mainmenu=4; selected=-1; keyselect=-1; break; case 8: flash(); SaveSettings(*this); mainmenu=gameon?2:1; break; case 9: invertmouse = !invertmouse; break; case 10: usermousesensitivity+=.2; if(usermousesensitivity>2) usermousesensitivity=.2; break; case 11: volume+=.1f; if(volume>1.0001f) volume=0; OPENAL_SetSFXMasterVolume((int)(volume*255)); break; case 12: flash(); newstereomode = stereomode; mainmenu=18; keyselect=-1; break; case 13: showdamagebar = !showdamagebar; break; } break; case 4: if(!waiting) { fireSound(); if(selected= accountactive->getCampaignChoicesMade())) { startbonustotal=0; loading=2; loadtime=0; targetlevel=7; if(firstload) TickOnceAfter(); else LoadStuff(); whichchoice=selected-NB_CAMPAIGN_MENU_ITEM-accountactive->getCampaignChoicesMade(); actuallevel=(accountactive->getCampaignChoicesMade()>0?campaignlevels[accountactive->getCampaignChoicesMade()-1].nextlevel[whichchoice]:0); visibleloading=1; stillloading=1; Loadlevel(campaignlevels[actuallevel].mapname.c_str()); campaign=1; mainmenu=0; gameon=1; pause_sound(stream_menutheme); } switch(selected){ case 1: startbonustotal=0; loading=2; loadtime=0; targetlevel=-1; if(firstload) { TickOnceAfter(); } else LoadStuff(); Loadlevel(-1); mainmenu=0; gameon=1; pause_sound(stream_menutheme); break; case 2: mainmenu=9; break; case 3: mainmenu=6; break; case 4: mainmenu=(gameon?2:1); break; case 5: mainmenu=7; break; case 6: vector campaigns = ListCampaigns(); vector::iterator c; if ((c = find(campaigns.begin(),campaigns.end(),accountactive->getCurrentCampaign()))==campaigns.end()) { if(!campaigns.empty()) accountactive->setCurrentCampaign(campaigns.front()); } else { c++; if(c==campaigns.end()) c=campaigns.begin(); accountactive->setCurrentCampaign(*c); } LoadCampaign(); break; } break; case 6: fireSound(); if(selected==1) { flash(); accountactive = Account::destroy(accountactive); mainmenu=7; } else if(selected==2) { flash(); mainmenu=5; } break; case 7: fireSound(); if(selected==0 && Account::getNbAccounts()<8){ entername=1; } else if (selected < Account::getNbAccounts()+1) { flash(); mainmenu=5; accountactive=Account::get(selected-1); } else if (selected == Account::getNbAccounts()+1) { flash(); mainmenu=5; for(int j=0;j<255;j++){ displaytext[0][j]=0; } displaychars[0]=0; displayselected=0; entername=0; } break; case 8: fireSound(); flash(); if(selected<=2) accountactive->setDifficulty(selected); mainmenu=5; break; case 9: if(selectedgetProgress()){ fireSound(); flash(); startbonustotal=0; loading=2; loadtime=0; targetlevel=selected; if(firstload) TickOnceAfter(); else LoadStuff(); Loadlevel(selected); campaign=0; mainmenu=0; gameon=1; pause_sound(stream_menutheme); } if(selected==numchallengelevels){ fireSound(); flash(); mainmenu=5; } break; case 10: if(selected==3){ fireSound(); flash(); mainmenu=5; } break; case 18: if(selected==1) stereoseparation+=0.001; else { fireSound(); if(selected==0){ newstereomode = (StereoMode)(newstereomode + 1); while(!CanInitStereo(newstereomode)){ printf("Failed to initialize mode %s (%i)\n", StereoModeName(newstereomode), newstereomode); newstereomode = (StereoMode)(newstereomode + 1); if(newstereomode >= stereoCount) newstereomode = stereoNone; } } else if(selected==2) { stereoreverse = !stereoreverse; } else if(selected==3) { flash(); mainmenu=3; stereomode = newstereomode; InitStereo(stereomode); } } break; } } if(Input::isKeyDown(SDLK_q) && Input::isKeyDown(SDLK_LMETA)){ tryquit=1; if(mainmenu==3) { SaveSettings(*this); } } OPENAL_SetFrequency(channels[stream_menutheme], 22050); if(entername) { inputText(displaytext[0],&displayselected,&displaychars[0]); if(!waiting) { // the input as finished if(displaychars[0]){ // with enter accountactive = Account::add(string(displaytext[0])); mainmenu=8; flash(); fireSound(firestartsound); for(int i=0;i<255;i++){ displaytext[0][i]=0; } displaychars[0]=0; displayselected=0; } entername=0; } displayblinkdelay-=multiplier; if(displayblinkdelay<=0){ displayblinkdelay=.3; displayblink=1-displayblink; } } } void Game::Tick(){ static XYZ facing,flatfacing; static int target; for(int i=0;i<15;i++){ displaytime[i]+=multiplier; } keyboardfrozen=false; Input::Tick(); if(Input::isKeyPressed(SDLK_F6)){ if(Input::isKeyDown(SDLK_LSHIFT)) stereoreverse=true; else stereoreverse=false; if(stereoreverse) printf("Stereo reversed\n"); else printf("Stereo unreversed\n"); } if(Input::isKeyDown(SDLK_F7)){ if(Input::isKeyDown(SDLK_LSHIFT)) stereoseparation -= 0.001; else stereoseparation -= 0.010; printf("Stereo decreased increased to %f\n", stereoseparation); } if(Input::isKeyDown(SDLK_F8)){ if(Input::isKeyDown(SDLK_LSHIFT)) stereoseparation += 0.001; else stereoseparation += 0.010; printf("Stereo separation increased to %f\n", stereoseparation); } if(Input::isKeyPressed(SDLK_TAB)&&tutoriallevel){ if(tutorialstage!=51) tutorialstagetime=tutorialmaxtime; emit_sound_np(consolefailsound, 128.); } /* Values of mainmenu : 1 Main menu 2 Menu pause (resume/end game) 3 Option menu 4 Controls configuration menu 5 Main game menu (choose level or challenge) 6 Deleting user menu 7 User managment menu (select/add) 8 Choose difficulty menu 9 Challenge level selection menu 10 End of the campaign congratulation (is that really a menu?) 11 Same that 9 ??? => unused 18 stereo configuration */ if(!console) { //campaign over? if(mainmenu&&endgame==1) mainmenu=10; //go to level select after completing a campaign level if(campaign&&winfreeze&&mainmenu==0&&campaignlevels[actuallevel].choosenext==1) { mainmenu=5; gameon=0; winfreeze=0; fireSound(); flash(); if(musictoggle) { OPENAL_SetFrequency(OPENAL_ALL, 0.001); emit_stream_np(stream_menutheme); pause_sound(leveltheme); } LoadCampaign(); } //escape key pressed //TODO: there must be code somewhere else that handles clicking the Back button, merge it with this if(Input::isKeyPressed(SDLK_ESCAPE)&& (gameon||mainmenu==0||(mainmenu>=3&&mainmenu!=8&&!(mainmenu==7&&entername)))) { selected=-1; if(mainmenu==0&&!winfreeze) mainmenu=2; //pause else if(mainmenu==1||mainmenu==2){ mainmenu=0; //unpause } //play menu theme if(musictoggle&&(mainmenu==1||mainmenu==2)){ OPENAL_SetFrequency(OPENAL_ALL, 0.001); emit_stream_np(stream_menutheme); pause_sound(leveltheme); } //on resume, play level music if(!mainmenu){ pause_sound(stream_menutheme); resume_stream(leveltheme); } //finished with settings menu if(mainmenu==3){ SaveSettings(*this); } //effects if(mainmenu>=3&&mainmenu!=8){ fireSound(); flash(); } //go back switch(mainmenu){ case 3: case 5: mainmenu=gameon?2:1; break; case 4: case 18: mainmenu=3; break; case 6: case 7: case 9: case 10: mainmenu=5; break; } } } if(mainmenu) { MenuTick(); } if(!mainmenu) { if(hostile==1)hostiletime+=multiplier; else hostiletime=0; if(!winfreeze)leveltime+=multiplier; //keys if(Input::isKeyPressed(SDLK_v)&&debugmode){ freeze=1-freeze; if(freeze){ OPENAL_SetFrequency(OPENAL_ALL, 0.001); } } if(Input::isKeyPressed(chatkey)&&!console&&!chatting&&debugmode) chatting=1; if(chatting){ inputText(displaytext[0],&displayselected,&displaychars[0]); if(!waiting) { if(displaychars[0]){ for(int j=0;j<255;j++) displaytext[0][j]=0; displaychars[0]=0; displayselected=0; } chatting=0; } displayblinkdelay-=multiplier; if(displayblinkdelay<=0){ displayblinkdelay=.3; displayblink=1-displayblink; } } if(chatting) keyboardfrozen=true; if(Input::isKeyPressed(consolekey)&&debugmode) { console=!console; if(console) { OPENAL_SetFrequency(OPENAL_ALL, 0.001); } else { freeze=0; waiting=false; } } if(console) freeze=1; if(console&&!Input::isKeyDown(SDLK_LMETA)) { inputText(consoletext[0],&consoleselected,&consolechars[0]); if(!waiting) { archiveselected=0; if(consolechars[0]>0) { consoletext[0][consolechars[0]]='\0'; cmd_dispatch(this, consoletext[0]); for(int k=14;k>=1;k--) { for(int j=0;j<255;j++) consoletext[k][j]=consoletext[k-1][j]; consolechars[k]=consolechars[k-1]; } for(int j=0;j<255;j++) consoletext[0][j]=0; consolechars[0]=0; consoleselected=0; } } consoleblinkdelay-=multiplier; if(consoleblinkdelay<=0) { consoleblinkdelay=.3; consoleblink=1-consoleblink; } } if(Input::isKeyDown(SDLK_q)&&Input::isKeyDown(SDLK_LMETA)){ tryquit=1; if(mainmenu==3) { SaveSettings(*this); } } static int oldwinfreeze; if(winfreeze&&!oldwinfreeze){ OPENAL_SetFrequency(OPENAL_ALL, 0.001); emit_sound_np(consolesuccesssound); } if(winfreeze==0) oldwinfreeze=winfreeze; else oldwinfreeze++; if((Input::isKeyPressed(jumpkey)||Input::isKeyPressed(SDLK_SPACE))&&!campaign) if(winfreeze) winfreeze=0; if((Input::isKeyDown(SDLK_ESCAPE))&&!campaign&&gameon){ if(console){ console=false; freeze=0; } else if(winfreeze) { mainmenu=9; gameon=0; } } //TODO: what is this test? if(!freeze&&!winfreeze&&!(mainmenu&&gameon)&&(gameon||!gamestarted)){ //dialogues if(indialogue!=-1) talkdelay=1; talkdelay-=multiplier; if(talkdelay<=0&&indialogue==-1&&animation[player[0].targetanimation].height!=highheight) for(int i=0;i49){ realdialoguetype=dialoguetype[i]-50; special=1; } else if(dialoguetype[i]>39){ realdialoguetype=dialoguetype[i]-40; special=1; } else if(dialoguetype[i]>29){ realdialoguetype=dialoguetype[i]-30; special=1; } else if(dialoguetype[i]>19){ realdialoguetype=dialoguetype[i]-20; special=1; } else if(dialoguetype[i]>9){ realdialoguetype=dialoguetype[i]-10; special=1; } else { realdialoguetype=dialoguetype[i]; special=0; } if((!hostile||dialoguetype[i]>40&&dialoguetype[i]<50)&& realdialoguetype0&& (dialoguegonethrough[i]==0||!special)&& (special||Input::isKeyPressed(attackkey))){ if(findDistancefast(&player[0].coords,&player[realdialoguetype].coords)<6|| player[realdialoguetype].howactive>=typedead1|| dialoguetype[i]>40&&dialoguetype[i]<50){ whichdialogue=i; for(int j=0;j0){ hotspot[i]=player[hotspottype[i]].coords; } } } //Tutorial if(tutoriallevel){ doTutorial(); } //bonuses if(tutoriallevel!=1){ if(bonustime==0&& bonus!=solidhit&& bonus!=spinecrusher&& bonus!=tracheotomy&& bonus!=backstab&& bonusvalue>10){ emit_sound_np(consolesuccesssound); } } else if(bonustime==0){ emit_sound_np(fireendsound); } if(bonustime==0){ if(bonus!=solidhit&& bonus!=twoxcombo&& bonus!=threexcombo&& bonus!=fourxcombo&& bonus!=megacombo) bonusnum[bonus]++; else bonusnum[bonus]+=0.15; if(tutoriallevel) bonusvalue=0; bonusvalue/=bonusnum[bonus]; bonustotal+=bonusvalue; } bonustime+=multiplier; //snow effects if(environment==snowyenvironment){ precipdelay-=multiplier; while(precipdelay<0){ precipdelay+=.04; if(!detail) precipdelay+=.04; XYZ footvel,footpoint; footvel=0; footpoint=viewer+viewerfacing*6; footpoint.y+=((float)abs(Random()%1200))/100-6; footpoint.x+=((float)abs(Random()%1200))/100-6; footpoint.z+=((float)abs(Random()%1200))/100-6; Sprite::MakeSprite(snowsprite, footpoint,footvel, 1,1,1, .1, 1); } } doAerialAcrobatics(); static XYZ oldviewer; //control keys if(indialogue==-1){ player[0].forwardkeydown=Input::isKeyDown(forwardkey); player[0].leftkeydown=Input::isKeyDown(leftkey); player[0].backkeydown=Input::isKeyDown(backkey); player[0].rightkeydown=Input::isKeyDown(rightkey); player[0].jumpkeydown=Input::isKeyDown(jumpkey); player[0].crouchkeydown=Input::isKeyDown(crouchkey); player[0].drawkeydown=Input::isKeyDown(drawkey); player[0].throwkeydown=Input::isKeyDown(throwkey); } else { player[0].forwardkeydown=0; player[0].leftkeydown=0; player[0].backkeydown=0; player[0].rightkeydown=0; player[0].jumpkeydown=0; player[0].crouchkeydown=0; player[0].drawkeydown=0; player[0].throwkeydown=0; } if(!player[0].jumpkeydown) player[0].jumpclimb=0; if(indialogue!=-1){ cameramode=1; if(directing){ facing=0; facing.z=-1; facing=DoRotation(facing,-rotation2,0,0); facing=DoRotation(facing,0,0-rotation,0); flatfacing=0; flatfacing.z=-1; flatfacing=DoRotation(flatfacing,0,-rotation,0); if(Input::isKeyDown(forwardkey)) viewer+=facing*multiplier*4; if(Input::isKeyDown(backkey)) viewer-=facing*multiplier*4; if(Input::isKeyDown(leftkey)) viewer+=DoRotation(flatfacing*multiplier,0,90,0)*4; if(Input::isKeyDown(rightkey)) viewer+=DoRotation(flatfacing*multiplier,0,-90,0)*4; if(Input::isKeyDown(jumpkey)) viewer.y+=multiplier*4; if(Input::isKeyDown(crouchkey)) viewer.y-=multiplier*4; if( Input::isKeyPressed(SDLK_1)|| Input::isKeyPressed(SDLK_2)|| Input::isKeyPressed(SDLK_3)|| Input::isKeyPressed(SDLK_4)|| Input::isKeyPressed(SDLK_5)|| Input::isKeyPressed(SDLK_6)|| Input::isKeyPressed(SDLK_7)|| Input::isKeyPressed(SDLK_8)|| Input::isKeyPressed(SDLK_9)|| Input::isKeyPressed(SDLK_0)|| Input::isKeyPressed(SDLK_MINUS)){ int whichend; if(Input::isKeyPressed(SDLK_1))whichend=1; if(Input::isKeyPressed(SDLK_2))whichend=2; if(Input::isKeyPressed(SDLK_3))whichend=3; if(Input::isKeyPressed(SDLK_4))whichend=4; if(Input::isKeyPressed(SDLK_5))whichend=5; if(Input::isKeyPressed(SDLK_6))whichend=6; if(Input::isKeyPressed(SDLK_7))whichend=7; if(Input::isKeyPressed(SDLK_8))whichend=8; if(Input::isKeyPressed(SDLK_9))whichend=9; if(Input::isKeyPressed(SDLK_0))whichend=0; if(Input::isKeyPressed(SDLK_MINUS)) whichend=-1; if(whichend!=-1){ participantfocus[whichdialogue][indialogue]=whichend; participantlocation[whichdialogue][whichend]=player[whichend].coords; participantrotation[whichdialogue][whichend]=player[whichend].rotation; } if(whichend==-1){ participantfocus[whichdialogue][indialogue]=-1; } if(player[participantfocus[whichdialogue][indialogue]].dead){ indialogue=-1; directing=0; cameramode=0; } dialoguecamera[whichdialogue][indialogue]=viewer; dialoguecamerarotation[whichdialogue][indialogue]=rotation; dialoguecamerarotation2[whichdialogue][indialogue]=rotation2; indialogue++; if(indialogue=numdialogueboxes[whichdialogue]){ indialogue=-1; directing=0; cameramode=0; } } if(!directing){ pause_sound(whooshsound); viewer=dialoguecamera[whichdialogue][indialogue]; viewer.y=max((double)viewer.y,terrain.getHeight(viewer.x,viewer.z)+.1); rotation=dialoguecamerarotation[whichdialogue][indialogue]; rotation2=dialoguecamerarotation2[whichdialogue][indialogue]; if(dialoguetime>0.5) if( Input::isKeyPressed(SDLK_1)|| Input::isKeyPressed(SDLK_2)|| Input::isKeyPressed(SDLK_3)|| Input::isKeyPressed(SDLK_4)|| Input::isKeyPressed(SDLK_5)|| Input::isKeyPressed(SDLK_6)|| Input::isKeyPressed(SDLK_7)|| Input::isKeyPressed(SDLK_8)|| Input::isKeyPressed(SDLK_9)|| Input::isKeyPressed(SDLK_0)|| Input::isKeyPressed(SDLK_MINUS)|| Input::isKeyPressed(attackkey)){ indialogue++; if(indialogue=numdialogueboxes[whichdialogue]){ indialogue=-1; directing=0; cameramode=0; if(dialoguetype[whichdialogue]>19&&dialoguetype[whichdialogue]<30){ hostile=1; } if(dialoguetype[whichdialogue]>29&&dialoguetype[whichdialogue]<40){ windialogue=true; } if(dialoguetype[whichdialogue]>49&&dialoguetype[whichdialogue]<60){ hostile=1; for(int i=1;i.8) player[i].avoidcollided=0; doAI(i); if(animation[player[i].targetanimation].attack==reversed){ //player[i].targetrotation=player[i].rotation; player[i].forwardkeydown=0; player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].jumpkeydown=0; player[i].attackkeydown=0; //player[i].crouchkeydown=0; player[i].throwkeydown=0; } if(indialogue!=-1){ player[i].forwardkeydown=0; player[i].leftkeydown=0; player[i].backkeydown=0; player[i].rightkeydown=0; player[i].jumpkeydown=0; player[i].crouchkeydown=0; player[i].drawkeydown=0; player[i].throwkeydown=0; } if(player[i].collided<-.3) player[i].collided=-.3; if(player[i].collided>1) player[i].collided=1; player[i].collided-=multiplier*4; player[i].whichdirectiondelay-=multiplier; if(player[i].avoidcollided<-.3||player[i].whichdirectiondelay<=0){ player[i].avoidcollided=-.3; player[i].whichdirection=abs(Random()%2); player[i].whichdirectiondelay=.4; } if(player[i].avoidcollided>1) player[i].avoidcollided=1; player[i].avoidcollided-=multiplier/4; if(!player[i].skeleton.free){ player[i].stunned-=multiplier; player[i].surprised-=multiplier; } if(i!=0&&player[i].surprised<=0&& player[i].aitype==attacktypecutoff&& !player[i].dead&& !player[i].skeleton.free&& animation[player[i].targetanimation].attack==neutral) numresponded=1; if(!player[i].throwkeydown) player[i].throwtogglekeydown=0; //pick up weapon if(player[i].throwkeydown&&!player[i].throwtogglekeydown){ if(player[i].weaponactive==-1&& player[i].num_weapons<2&& (player[i].isIdle()|| player[i].isCrouch()|| player[i].targetanimation==sneakanim|| player[i].targetanimation==rollanim|| player[i].targetanimation==backhandspringanim|| player[i].isFlip()|| player[i].isFlip()|| player[i].aitype!=playercontrolled)){ for(int j=0;jid) if(findDistancefastflat(&player[i].coords,&weapons[j].position)<2&&player[i].weaponactive==-1) if(findDistancefast(&player[i].coords,&weapons[j].position)<1||player[i].victim){ if(weapons[j].getType()!=staff) emit_sound_at(knifedrawsound, player[i].coords, 128.); player[i].weaponactive=0; weapons[j].owner=player[i].id; if(player[i].num_weapons>0) player[i].weaponids[player[i].num_weapons]=player[i].weaponids[0]; player[i].num_weapons++; player[i].weaponids[0]=j; } } }else if((player[i].isIdle()|| player[i].isFlip()|| player[i].aitype!=playercontrolled)&& findDistancefast(&player[i].coords,&weapons[j].position)<5&& player[i].coords.yid) if(findDistancefastflat(&player[i].coords,&weapons[k].position)<3&& player[i].weaponactive==-1){ if(weapons[k].getType()!=staff) emit_sound_at(knifedrawsound, player[i].coords, 128.); player[i].weaponactive=0; weapons[k].owner=player[i].id; if(player[i].num_weapons>0) player[i].weaponids[player[i].num_weapons]=player[i].weaponids[0]; player[i].num_weapons++; player[i].weaponids[0]=k; } } } } } } if(player[i].isCrouch()|| player[i].targetanimation==sneakanim|| player[i].isRun()|| player[i].isIdle()||player[i].targetanimation==rollanim|| player[i].targetanimation==backhandspringanim){ if(numplayers>1) for(int j=0;j0&& player[j].weaponstuckwhere==1))|| player[j].weaponstuck==-1|| player[j].num_weapons>1)){ if(player[i].targetanimation!=rollanim&&player[i].targetanimation!=backhandspringanim){ player[i].throwtogglekeydown=1; player[i].victim=&player[j]; player[i].hasvictim=1; player[i].setAnimation(crouchremoveknifeanim); player[i].targetrotation=roughDirectionTo(player[i].coords,player[j].coords); } if(player[i].targetanimation==rollanim||player[i].targetanimation==backhandspringanim){ player[i].throwtogglekeydown=1; player[i].victim=&player[j]; player[i].hasvictim=1; int k = player[j].weaponids[0]; if(player[i].hasvictim){ bool fleshstuck; fleshstuck=0; if(player[i].victim->weaponstuck!=-1){ if(player[i].victim->weaponids[player[i].victim->weaponstuck]==k){ fleshstuck=1; } } if(!fleshstuck){ if(weapons[k].getType()!=staff) emit_sound_at(knifedrawsound, player[i].coords, 128.); } if(fleshstuck) emit_sound_at(fleshstabremovesound, player[i].coords, 128.); player[i].weaponactive=0; if(weapons[k].owner!=-1){ if(player[i].victim->num_weapons==1)player[i].victim->num_weapons=0; else player[i].victim->num_weapons=1; player[i].victim->skeleton.longdead=0; player[i].victim->skeleton.free=1; player[i].victim->skeleton.broken=0; for(int l=0;lskeleton.num_joints;l++){ player[i].victim->skeleton.joints[l].velchange=0; player[i].victim->skeleton.joints[l].locked=0; } XYZ relative; relative=0; relative.y=10; Normalise(&relative); XYZ footvel,footpoint; footvel=0; footpoint=weapons[k].position; if(player[i].victim->weaponstuck!=-1){ if(player[i].victim->weaponids[player[i].victim->weaponstuck]==k){ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); weapons[k].bloody=2; weapons[k].blooddrip=5; player[i].victim->weaponstuck=-1; player[i].victim->bloodloss+=2000; player[i].victim->DoDamage(2000); } } if(player[i].victim->num_weapons>0){ if(player[i].victim->weaponstuck!=0&&player[i].victim->weaponstuck!=-1)player[i].victim->weaponstuck=0; if(player[i].victim->weaponids[0]==k) player[i].victim->weaponids[0]=player[i].victim->weaponids[player[i].victim->num_weapons]; } player[i].victim->weaponactive=-1; player[i].victim->getJointFor(abdomen).velocity+=relative*6; player[i].victim->getJointFor(neck).velocity+=relative*6; player[i].victim->getJointFor(rightshoulder).velocity+=relative*6; player[i].victim->getJointFor(leftshoulder).velocity+=relative*6; } weapons[k].owner=i; if(player[i].num_weapons>0){ player[i].weaponids[player[i].num_weapons]=player[i].weaponids[0]; } player[i].num_weapons++; player[i].weaponids[0]=k; } } } } } } if(player[i].weaponactive!=-1&&player[i].aitype==playercontrolled){ if(weapons[player[i].weaponids[0]].getType()==knife){ if(player[i].isIdle()|| player[i].isRun()|| player[i].isCrouch()|| player[i].targetanimation==sneakanim|| player[i].isFlip()) if(numplayers>1) for(int j=0;j1.5&& !player[j].skeleton.free&& -1==checkcollide(DoRotation(player[j].getJointFor(head).position,0,player[j].rotation,0)*player[j].scale+player[j].coords,DoRotation(player[i].getJointFor(head).position,0,player[i].rotation,0)*player[i].scale+player[i].coords)){ if(!player[i].isFlip()){ player[i].throwtogglekeydown=1; player[i].victim=&player[j]; player[i].setAnimation(knifethrowanim); player[i].targetrotation=roughDirectionTo(player[i].coords,player[j].coords); player[i].targettilt2=pitchTo(player[i].coords,player[j].coords); } if(player[i].isFlip()){ if(player[i].weaponactive!=-1){ player[i].throwtogglekeydown=1; player[i].victim=&player[j]; XYZ aim; weapons[player[i].weaponids[0]].owner=-1; aim=player[i].victim->coords+DoRotation(player[i].victim->getJointFor(abdomen).position,0,player[i].victim->rotation,0)*player[i].victim->scale+player[i].victim->velocity*findDistance(&player[i].victim->coords,&player[i].coords)/50-(player[i].coords+DoRotation(player[i].getJointFor(righthand).position,0,player[i].rotation,0)*player[i].scale); Normalise(&aim); aim=DoRotation(aim,(float)abs(Random()%30)-15,(float)abs(Random()%30)-15,0); weapons[player[i].weaponids[0]].velocity=aim*50; weapons[player[i].weaponids[0]].tipvelocity=aim*50; weapons[player[i].weaponids[0]].missed=0; weapons[player[i].weaponids[0]].freetime=0; weapons[player[i].weaponids[0]].firstfree=1; weapons[player[i].weaponids[0]].physics=0; player[i].num_weapons--; if(player[i].num_weapons){ player[i].weaponids[0]=player[i].weaponids[player[i].num_weapons]; } player[i].weaponactive=-1; } } } } } } if(player[i].weaponactive!=-1&&player[i].aitype==playercontrolled){ if(player[i].isCrouch()||player[i].targetanimation==sneakanim){ player[i].throwtogglekeydown=1; weapons[player[i].weaponids[0]].owner=-1; weapons[player[i].weaponids[0]].velocity=player[i].velocity*.2; if(weapons[player[i].weaponids[0]].velocity.x==0)weapons[player[i].weaponids[0]].velocity.x=.1; weapons[player[i].weaponids[0]].tipvelocity=weapons[player[i].weaponids[0]].velocity; weapons[player[i].weaponids[0]].missed=1; weapons[player[i].weaponids[0]].freetime=0; weapons[player[i].weaponids[0]].firstfree=1; weapons[player[i].weaponids[0]].physics=1; player[i].num_weapons--; if(player[i].num_weapons){ player[i].weaponids[0]=player[i].weaponids[player[i].num_weapons]; if(player[i].weaponstuck==player[i].num_weapons)player[i].weaponstuck=0; } player[i].weaponactive=-1; for(int j=0;j1) for(int j=0;j1) for(int j=0;jcoords)<3&& player[j].victim==&player[i]&& (player[j].targetanimation==sweepanim|| player[j].targetanimation==upunchanim|| player[j].targetanimation==wolfslapanim|| ((player[j].targetanimation==swordslashanim|| player[j].targetanimation==knifeslashstartanim|| player[j].targetanimation==staffhitanim|| player[j].targetanimation==staffspinhitanim)&& findDistancefast(&player[j].coords,&player[i].coords)<2))){ if(target>=0) target=-1; else target=j; } } } if(target>=0) player[target].Reverse(); player[i].lowreversaldelay=.5; if(player[i].isIdle()){ player[i].setAnimation(player[i].getCrouch()); player[i].transspeed=10; } if(player[i].isRun()|| (player[i].isStop()&& (player[i].leftkeydown|| player[i].rightkeydown|| player[i].forwardkeydown|| player[i].backkeydown))){ player[i].setAnimation(rollanim); player[i].transspeed=20; } } if(!player[i].crouchkeydown){ //Uncrouch if(!player[i].isRun()&&player[i].targetanimation!=sneakanim&&i==0)player[i].superruntoggle=0; target=-2; if(player[i].isCrouch()){ if(numplayers>1) for(int j=0;jcoords)<3&& player[j].victim==&player[i]&& (player[j].targetanimation==spinkickanim)&& player[i].isCrouch()){ if(target>=0) target=-1; else target=j; } } } if(target>=0) player[target].Reverse(); player[i].highreversaldelay=.5; if(player[i].isCrouch()){ if(!player[i].wasCrouch()){ player[i].currentanimation=player[i].getCrouch(); player[i].currentframe=0; } player[i].setAnimation(player[i].getIdle()); player[i].transspeed=10; } } if(player[i].targetanimation==sneakanim){ player[i].setAnimation(player[i].getIdle()); player[i].transspeed=10; } } if(player[i].forwardkeydown){ if(player[i].isIdle()|| (player[i].isStop()&& player[i].targetrotation==player[i].rotation)|| (player[i].isLanding()&& player[i].targetframe>0&& !player[i].jumpkeydown)|| (player[i].isLandhard()&& player[i].targetframe>0&& !player[i].jumpkeydown&& player[i].crouchkeydown)){ if(player[i].aitype==passivetype) player[i].setAnimation(walkanim); else player[i].setAnimation(player[i].getRun()); } if(player[i].isCrouch()){ player[i].targetanimation=sneakanim; if(player[i].wasCrouch()) player[i].target=0; player[i].targetframe=0; } if(player[i].targetanimation==hanganim/*&&(!player[i].forwardstogglekeydown||player[i].aitype!=playercontrolled)*/){ player[i].setAnimation(climbanim); player[i].targetframe=1; player[i].jumpclimb=1; } if(player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip()){ player[i].velocity+=absflatfacing*5*multiplier; } player[i].forwardstogglekeydown=1; movekey=1; } if (player[i].rightkeydown){ if(player[i].isIdle()|| (player[i].isStop()&& player[i].targetrotation==player[i].rotation)|| (player[i].isLanding()&& player[i].targetframe>0&& !player[i].jumpkeydown)|| (player[i].isLandhard()&& player[i].targetframe>0&& !player[i].jumpkeydown&& player[i].crouchkeydown)){ player[i].setAnimation(player[i].getRun()); } if(player[i].isCrouch()){ player[i].targetanimation=sneakanim; if(player[i].wasCrouch()) player[i].target=0; player[i].targetframe=0; } if(player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip()){ player[i].velocity+=DoRotation(absflatfacing*5*multiplier,0,-90,0); } player[i].targetrotation-=90; if(player[i].forwardkeydown)player[i].targetrotation+=45; if(player[i].backkeydown)player[i].targetrotation-=45; movekey=1; } if ( player[i].leftkeydown){ if(player[i].isIdle()|| (player[i].isStop()&& player[i].targetrotation==player[i].rotation)|| (player[i].isLanding()&& player[i].targetframe>0&& !player[i].jumpkeydown)|| (player[i].isLandhard()&& player[i].targetframe>0&& !player[i].jumpkeydown&& player[i].crouchkeydown)){ player[i].setAnimation(player[i].getRun()); } if(player[i].isCrouch()){ player[i].targetanimation=sneakanim; if(player[i].wasCrouch()) player[i].target=0; player[i].targetframe=0; } if(player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip()){ player[i].velocity-=DoRotation(absflatfacing*5*multiplier,0,-90,0); } player[i].targetrotation+=90; if(player[i].forwardkeydown)player[i].targetrotation-=45; if(player[i].backkeydown)player[i].targetrotation+=45; movekey=1; } if(player[i].backkeydown){ if(player[i].isIdle()|| (player[i].isStop()&& player[i].targetrotation==player[i].rotation)|| (player[i].isLanding()&& player[i].targetframe>0&& !player[i].jumpkeydown)|| (player[i].isLandhard()&& player[i].targetframe>0&& !player[i].jumpkeydown&& player[i].crouchkeydown)){ player[i].setAnimation(player[i].getRun()); } if(player[i].isCrouch()){ player[i].targetanimation=sneakanim; if(player[i].wasCrouch()) player[i].target=0; player[i].targetframe=0; } if(player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip()){ player[i].velocity-=absflatfacing*5*multiplier; } if(player[i].targetanimation==hanganim){ player[i].currentanimation=jumpdownanim; player[i].targetanimation=jumpdownanim; player[i].target=0; player[i].currentframe=0; player[i].targetframe=1; player[i].velocity=0; player[i].velocity.y+=gravity; player[i].coords.y-=1.4; player[i].grabdelay=1; } if ( !player[i].leftkeydown&&!player[i].rightkeydown) player[i].targetrotation+=180; movekey=1; } if((player[i].jumpkeydown&&!player[i].jumpclimb)||player[i].jumpstart){ if((((player[i].isLanding()&&player[i].targetframe>=3)|| player[i].isRun()|| player[i].targetanimation==walkanim|| player[i].isCrouch()|| player[i].targetanimation==sneakanim)&& player[i].jumppower>1)&& ((player[i].targetanimation!=rabbitrunninganim&& player[i].targetanimation!=wolfrunninganim)||i!=0)){ player[i].jumpstart=0; player[i].setAnimation(jumpupanim); player[i].rotation=player[i].targetrotation; player[i].transspeed=20; player[i].FootLand(0,1); player[i].FootLand(1,1); facing=0; facing.z=-1; flatfacing=DoRotation(facing,0,player[i].targetrotation+180,0); if(movekey)player[i].velocity=flatfacing*player[i].speed*45*player[i].scale; if(!movekey)player[i].velocity=0; //Dodge sweep? target=-2; if(numplayers>1) for(int j=0;jcoords)<3&& player[j].victim==&player[i]&& (player[j].targetanimation==sweepanim)){ if(target>=0)target=-1; else target=j; } } } if(target>=0)player[i].velocity.y=1; else if(player[i].crouchkeydown||player[i].aitype!=playercontrolled){ player[i].velocity.y=7; player[i].crouchtogglekeydown=1; } else player[i].velocity.y=5; if(mousejump&&i==0&&debugmode){ if(!player[i].isLanding())player[i].tempdeltav=deltav; if(player[i].tempdeltav<0)player[i].velocity.y-=(float)(player[i].tempdeltav)/multiplier/1000; } player[i].coords.y+=.2; player[i].jumppower-=1; if (!i) emit_sound_at(whooshsound, player[i].coords, 128.); emit_sound_at(jumpsound, player[i].coords, 128.); } if((player[i].isIdle())&&player[i].jumppower>1){ player[i].setAnimation(player[i].getLanding()); player[i].targetframe=2; player[i].landhard=0; player[i].jumpstart=1; player[i].tempdeltav=deltav; } if(player[i].targetanimation==jumpupanim&& (((!floatjump&& !editorenabled)|| !debugmode)|| player[i].aitype!=playercontrolled)){ if(player[i].jumppower>multiplier*6){ player[i].velocity.y+=multiplier*6; player[i].jumppower-=multiplier*6; } if(player[i].jumppower<=multiplier*6){ player[i].velocity.y+=player[i].jumppower; player[i].jumppower=0; } } if(((floatjump||editorenabled)&&debugmode)&&i==0)player[i].velocity.y+=multiplier*30; } if(!movekey){ if(player[i].isRun()||player[i].targetanimation==walkanim) player[i].setAnimation(player[i].getStop()); if(player[i].targetanimation==sneakanim){ player[i].targetanimation=player[i].getCrouch(); if(player[i].currentanimation==sneakanim) player[i].target=0; player[i].targetframe=0; } } if(player[i].targetanimation==walkanim&& (player[i].aitype==attacktypecutoff|| player[i].aitype==searchtype|| (player[i].aitype==passivetype&& player[i].numwaypoints<=1))) player[i].setAnimation(player[i].getStop()); if(player[i].isRun()&&(player[i].aitype==passivetype)) player[i].setAnimation(player[i].getStop()); } } if(player[i].targetanimation==rollanim) player[i].targetrotation=oldtargetrotation; } //Rotation for(int k=0;k180){ if(player[k].rotation>player[k].targetrotation) player[k].rotation-=360; else player[k].rotation+=360; } //stop to turn in right direction if(fabs(player[k].rotation-player[k].targetrotation)>90&&(player[k].isRun()||player[k].targetanimation==walkanim)) player[k].setAnimation(player[k].getStop()); if(player[k].targetanimation==backhandspringanim||player[k].targetanimation==dodgebackanim) player[k].targettilt=0; if(player[k].targetanimation!=jumpupanim&& player[k].targetanimation!=backhandspringanim&& player[k].targetanimation!=jumpdownanim&& !player[k].isFlip()){ player[k].targettilt=0; if(player[k].jumppower<0&&!player[k].jumpkeydown) player[k].jumppower=0; player[k].jumppower+=multiplier*7; if(player[k].isCrouch()) player[k].jumppower+=multiplier*7; if(player[k].jumppower>5) player[k].jumppower=5; } if(player[k].isRun()) player[k].targettilt=(player[k].rotation-player[k].targetrotation)/4; player[k].tilt=stepTowardf(player[k].tilt,player[k].targettilt,multiplier*150); player[k].grabdelay-=multiplier; } //do animations for(int k=0;k=0;j--){ envsoundlife[j]-=multiplier; if(envsoundlife[j]<0){ numenvsounds--; envsoundlife[j]=envsoundlife[numenvsounds]; envsound[j]=envsound[numenvsounds]; } } if(slomo) OPENAL_SetFrequency(OPENAL_ALL, slomofreq); else OPENAL_SetFrequency(OPENAL_ALL, 22050); if(tutoriallevel==1){ XYZ temp; XYZ temp2; XYZ temp3; XYZ oldtemp; XYZ oldtemp2; temp.x=1011; temp.y=84; temp.z=491; temp2.x=1025; temp2.y=75; temp2.z=447; temp3.x=1038; temp3.y=76; temp3.z=453; oldtemp=temp; oldtemp2=temp2; if(tutorialstage>=51) if(findDistancefast(&temp,&player[0].coords)>=findDistancefast(&temp,&temp2)-1||findDistancefast(&temp3,&player[0].coords)<4){ OPENAL_StopSound(OPENAL_ALL); // hack...OpenAL renderer isn't stopping music after tutorial goes to level menu... OPENAL_SetFrequency(OPENAL_ALL, 0.001); emit_stream_np(stream_menutheme); gameon=0; mainmenu=5; fireSound(); flash(); } if(tutorialstage<51) if(findDistancefast(&temp,&player[0].coords)>=findDistancefast(&temp,&temp2)-1||findDistancefast(&temp3,&player[0].coords)<4){ emit_sound_at(fireendsound, player[0].coords); player[0].coords=(oldtemp+oldtemp2)/2; flash(); } if(tutorialstage>=14&&tutorialstage<50) if(findDistancefast(&temp,&player[1].coords)>=findDistancefast(&temp,&temp2)-1||findDistancefast(&temp3,&player[1].coords)<4){ emit_sound_at(fireendsound, player[1].coords); for(int i=0;i90) rotation2=90; if(rotation2<-70) rotation2=-70; } } void Game::TickOnceAfter(){ static XYZ colviewer; static XYZ coltarget; static XYZ target; static XYZ col; static XYZ facing; static float changedelay; static bool alldead; static float unseendelay; static float cameraspeed; if(!mainmenu){ if(environment==snowyenvironment) leveltheme=stream_snowtheme; if(environment==grassyenvironment) leveltheme=stream_grasstheme; if(environment==desertenvironment) leveltheme=stream_deserttheme; realthreat=0; musictype=leveltheme; for(int i=0;i0) musictype=stream_fighttheme; } if(loading==2){ musictype=stream_menutheme; musicvolume[2]=512; musicvolume[0]=0; musicvolume[1]=0; musicvolume[3]=0; } if(musictoggle) if(musictype!=oldmusictype&&musictype==stream_fighttheme) emit_sound_np(alarmsound); musicselected=musictype; if(musicselected==leveltheme) musicvolume[0]+=multiplier*450; else musicvolume[0]-=multiplier*450; if(musicselected==stream_fighttheme) musicvolume[1]+=multiplier*450; else musicvolume[1]-=multiplier*450; if(musicselected==stream_menutheme) musicvolume[2]+=multiplier*450; else musicvolume[2]-=multiplier*450; for(int i=0;i<3;i++){ if(musicvolume[i]<0) musicvolume[i]=0; if(musicvolume[i]>512) musicvolume[i]=512; } if(musicvolume[2]>128&&!loading&&!mainmenu) musicvolume[2]=128; if(musictoggle){ if(musicvolume[0]>0&&oldmusicvolume[0]<=0) emit_stream_np(leveltheme, musicvolume[0]); if(musicvolume[1]>0&&oldmusicvolume[1]<=0) emit_stream_np(stream_fighttheme, musicvolume[1]); if(musicvolume[2]>0&&oldmusicvolume[2]<=0) emit_stream_np(stream_menutheme, musicvolume[2]); if(musicvolume[0]<=0&&oldmusicvolume[0]>0) pause_sound(leveltheme); if(musicvolume[1]<=0&&oldmusicvolume[1]>0) pause_sound(stream_fighttheme); if(musicvolume[2]<=0&&oldmusicvolume[2]>0) pause_sound(stream_menutheme); if(musicvolume[0]!=oldmusicvolume[0]) OPENAL_SetVolume(channels[leveltheme], musicvolume[0]); if(musicvolume[1]!=oldmusicvolume[1]) OPENAL_SetVolume(channels[stream_fighttheme], musicvolume[1]); if(musicvolume[2]!=oldmusicvolume[2]) OPENAL_SetVolume(channels[stream_menutheme], musicvolume[2]); for(int i=0;i<3;i++) oldmusicvolume[i]=musicvolume[i]; } else { pause_sound(leveltheme); pause_sound(stream_fighttheme); pause_sound(stream_menutheme); for(int i=0;i<4;i++){ oldmusicvolume[i]=0; musicvolume[i]=0; } } killhotspot=2; for(int i=0;i10&&hotspottype[i]<20){ if(player[hotspottype[i]-10].dead==0) killhotspot=0; else if(killhotspot==2) killhotspot=1; } } if(killhotspot==2) killhotspot=0; winhotspot=false; for(int i=0;imaxalarmed) maxalarmed=numalarmed; if(changedelay<=0&&!loading&&!editorenabled&&gameon&&!tutoriallevel&&changedelay!=-999&&!won){ if(player[0].dead&&changedelay<=0){ changedelay=1; targetlevel=whichlevel; } alldead=true; for(int i=1;inumchallengelevels-1)targetlevel=0; } if(winhotspot||windialogue) { changedelay=0.1; targetlevel=whichlevel+1; if(targetlevel>numchallengelevels-1)targetlevel=0; } if(killhotspot){ changedelay=1; targetlevel=whichlevel+1; if(targetlevel>numchallengelevels-1)targetlevel=0; } if(changedelay>0&&!player[0].dead&&!won) { //high scores, awards, win if(campaign) { accountactive->winCampaignLevel(whichchoice, bonustotal, leveltime); scoreadded=1; } else { accountactive->winLevel(whichlevel,bonustotal-startbonustotal,leveltime); } won=1; } } if(!winfreeze){ if(leveltime<1){ loading=0; changedelay=.1; alldead=false; winhotspot=false; killhotspot=0; } if(!editorenabled&&gameon&&!mainmenu) { if(changedelay!=-999) changedelay-=multiplier/7; if(player[0].dead) targetlevel=whichlevel; if(loading==2&&!campaign){ flash(); fireSound(firestartsound); if(!player[0].dead&&targetlevel!=whichlevel) startbonustotal=bonustotal; if(player[0].dead) Loadlevel(whichlevel); else Loadlevel(targetlevel); fireSound(); loading=3; } if(loading==2&&targetlevel==whichlevel){ flash(); loadtime=0; fireSound(firestartsound); Loadlevel(campaignlevels[accountactive->getCampaignChoicesMade()].mapname.c_str()); fireSound(); loading=3; } if(changedelay<=-999&& whichlevel!=-2&& !loading&& (player[0].dead|| (alldead&&maptype==mapkilleveryone)|| (winhotspot)|| (killhotspot))) loading=1; if((player[0].dead|| (alldead&&maptype==mapkilleveryone)|| (winhotspot)|| (windialogue)|| (killhotspot))&& changedelay<=0) { if(whichlevel!=-2&&!loading&&!player[0].dead) { winfreeze=true; changedelay=-999; } if(player[0].dead) loading=1; } } if(campaign) { // campaignchoosenext determines what to do when the level is complete: // 0 = load next level // 1 = go back to level select screen // 2 = stealthload next level if(mainmenu==0&&winfreeze&&(campaignlevels[actuallevel].choosenext)==1) { if(campaignlevels[actuallevel].nextlevel.empty()) endgame=1; } else if(mainmenu==0&&winfreeze) { stealthloading = (campaignlevels[actuallevel].choosenext==2); if(!stealthloading){ fireSound(firestartsound); flash(); } startbonustotal=0; LoadCampaign(); loading=2; loadtime=0; targetlevel=7; if(!firstload) LoadStuff(); whichchoice=0; actuallevel=campaignlevels[actuallevel].nextlevel.front(); visibleloading=1; stillloading=1; Loadlevel(campaignlevels[actuallevel].mapname.c_str()); campaign=1; mainmenu=0; gameon=1; pause_sound(stream_menutheme); stealthloading=0; } } if(loading==3) loading=0; } oldmusictype=musictype; } facing=0; facing.z=-1; facing=DoRotation(facing,-rotation2,0,0); facing=DoRotation(facing,0,0-rotation,0); viewerfacing=facing; if(!cameramode){ if((animation[player[0].targetanimation].attack!=3&&animation[player[0].currentanimation].attack!=3)||player[0].skeleton.free)target=player[0].coords+player[0].currentoffset*(1-player[0].target)*player[0].scale+player[0].targetoffset*player[0].target*player[0].scale-player[0].facing*.05; else target=player[0].oldcoords+player[0].currentoffset*(1-player[0].target)*player[0].scale+player[0].targetoffset*player[0].target*player[0].scale-player[0].facing*.05; target.y+=.1; if(player[0].skeleton.free){ for(int i=0;itarget.y) target.y=player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y; } target.y+=.1; } if(player[0].skeleton.free!=2&&!autocam){ cameraspeed=20; if(findLengthfast(&player[0].velocity)>400){ cameraspeed=20+(findLength(&player[0].velocity)-20)*.96; } if(player[0].skeleton.free==0&&player[0].targetanimation!=hanganim&&player[0].targetanimation!=climbanim)target.y+=1.4; coltarget=target-cameraloc; if(findLengthfast(&coltarget)2.3)cameradist=2.3; viewer=cameraloc-facing*cameradist; colviewer=viewer; coltarget=cameraloc; objects.SphereCheckPossible(&colviewer, findDistance(&colviewer,&coltarget)); if(terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz]) for(int j=0;j400){ cameraspeed=20+(findLength(&player[0].velocity)-20)*.96; } if(player[0].skeleton.free==0&&player[0].targetanimation!=hanganim&&player[0].targetanimation!=climbanim)target.y+=1.4; cameradist+=multiplier*5; if(cameradist>3.3)cameradist=3.3; coltarget=target-cameraloc; if(findLengthfast(&coltarget)1) { Normalise(&coltarget); if(player[0].targetanimation!=hanganim&&player[0].targetanimation!=climbanim&&player[0].currentanimation!=climbanim&&player[0].currentoffset.x==0)cameraloc=cameraloc+coltarget*multiplier*cameraspeed; else cameraloc=cameraloc+coltarget*multiplier*8; } if(editorenabled)cameraloc=target; viewer=cameraloc; colviewer=viewer; coltarget=cameraloc; objects.SphereCheckPossible(&colviewer, findDistance(&colviewer,&coltarget)); if(terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz]) for(int j=0;j.8)camerashake=.8; //if(woozy>10)woozy=10; //woozy+=multiplier; woozy+=multiplier; if(player[0].dead)camerashake=0; if(player[0].dead)woozy=0; camerashake-=multiplier*2; blackout-=multiplier*2; //if(player[0].isCrouch())woozy-=multiplier*8; if(camerashake<0)camerashake=0; if(blackout<0)blackout=0; //if(woozy<0)woozy=0; if(camerashake){ viewer.x+=(float)(Random()%100)*.0005*camerashake; viewer.y+=(float)(Random()%100)*.0005*camerashake; viewer.z+=(float)(Random()%100)*.0005*camerashake; } } } lugaru-0~20110520.1+hge4354.orig/Source/Models.h0000644000000000000000000000755011571222446017245 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MODELS_H_ #define _MODELS_H_ /**> Model Loading <**/ // // Model Maximums // #include "gamegl.h" #include #include #include #include #include "Terrain.h" #include "binio.h" #include "Quaternions.h" // // Textures List // typedef struct { long xsz,ysz; GLubyte *txt; } ModelTexture; // // Model Structures // class TexturedTriangle{ public: short vertex[3]; float gx[3],gy[3]; }; #define max_model_decals 300 #define nothing 0 #define normaltype 4 #define notextype 1 #define rawtype 2 #define decalstype 3 class Model{ public: short vertexNum,TriangleNum; bool hastexture; int type,oldtype; int* possible; int* owner; XYZ* vertex; XYZ* normals; XYZ* facenormals; TexturedTriangle* Triangles; GLfloat* vArray; /*int possible[max_model_vertex]; int owner[max_textured_triangle]; XYZ vertex[max_model_vertex]; XYZ normals[max_model_vertex]; XYZ facenormals[max_textured_triangle]; TexturedTriangle Triangles[max_textured_triangle]; GLfloat vArray[max_textured_triangle*24];*/ GLuint textureptr; ModelTexture Texture; int numpossible; bool color; XYZ boundingspherecenter; float boundingsphereradius; float*** decaltexcoords; XYZ** decalvertex; int* decaltype; float* decalopacity; float* decalrotation; float* decalalivetime; XYZ* decalposition; /*float decaltexcoords[max_model_decals][3][2]; XYZ decalvertex[max_model_decals][3]; int decaltype[max_model_decals]; float decalopacity[max_model_decals]; float decalrotation[max_model_decals]; float decalalivetime[max_model_decals]; XYZ decalposition[max_model_decals];*/ int numdecals; bool flat; void DeleteDecal(int which); void MakeDecal(int atype, XYZ *where, float *size, float *opacity, float *rotation); void MakeDecal(int atype, XYZ where, float size, float opacity, float rotation); void drawdecals(GLuint shadowtexture,GLuint bloodtexture,GLuint bloodtexture2,GLuint breaktexture); int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate); int SphereCheckPossible(XYZ *p1,float radius, XYZ *move, float *rotate); int LineCheck(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate); int LineCheckSlide(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate); int LineCheckPossible(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate); int LineCheckSlidePossible(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate); void UpdateVertexArray(); void UpdateVertexArrayNoTex(); void UpdateVertexArrayNoTexNoNorm(); bool loadnotex(const char *filename); bool loadraw(char *filename); bool load(const char *filename,bool texture); bool loaddecal(const char *filename,bool texture); void Scale(float xscale,float yscale,float zscale); void FlipTexCoords(); void UniformTexCoords(); void ScaleTexCoords(float howmuch); void ScaleNormals(float xscale,float yscale,float zscale); void Translate(float xtrans,float ytrans,float ztrans); void CalculateNormals(bool facenormalise); void draw(); void drawdifftex(GLuint texture); void drawimmediate(); void drawdiffteximmediate(GLuint texture); void Rotate(float xang,float yang,float zang); ~Model(); void deallocate(); Model(); }; #endif lugaru-0~20110520.1+hge4354.orig/Source/Weapons.cpp0000644000000000000000000011457711571222446020001 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /**> HEADER FILES <**/ #include "Weapons.h" #include "openal_wrapper.h" #include "Animation.h" #include "Sounds.h" #include "Game.h" #include "Awards.h" extern float multiplier; extern Terrain terrain; extern float gravity; extern int environment; extern int detail; extern FRUSTUM frustum; extern XYZ viewer; extern float realmultiplier; extern int slomo; extern float slomodelay; extern bool cellophane; extern float texdetail; extern GLubyte bloodText[512*512*3]; extern int bloodtoggle; extern Objects objects; extern bool osx; extern bool autoslomo; extern float camerashake; extern float woozy; extern float viewdistance; extern float blackout; extern int difficulty; extern bool freeze; extern int tutoriallevel; extern int numthrowkill; Model Weapon::throwingknifemodel; GLuint Weapon::knifetextureptr = 0; GLuint Weapon::lightbloodknifetextureptr = 0; GLuint Weapon::bloodknifetextureptr = 0; Model Weapon::swordmodel; GLuint Weapon::swordtextureptr = 0; GLuint Weapon::lightbloodswordtextureptr = 0; GLuint Weapon::bloodswordtextureptr = 0; Model Weapon::staffmodel; GLuint Weapon::stafftextureptr = 0; Weapon::Weapon(int t, int o) : owner(o) { setType(t); bloody=0; blooddrip=0; blooddripdelay=0; onfire=0; flamedelay=0; damage=0; position=-1000; tippoint=-1000; } void Weapon::setType(int t) { type = t; if(type==sword){ mass=1.5; tipmass=1; length=.8; } if(type==staff){ mass=2; tipmass=1; length=1.5; } if(type==knife){ mass=1; tipmass=1.2; length=.25; } } void Weapon::DoStuff(int i) { //~ cout << position.x << "," << position.y << "," << position.z << "|" << tippoint.x << "," << tippoint.y << "," << tippoint.z << endl; static int whichpatchx,whichpatchz,whichhit; static XYZ start,end,colpoint,normalrot,footvel,footpoint; static XYZ terrainnormal; static XYZ vel; static XYZ midp; static XYZ newpoint1,newpoint2; static float friction=3.5; static float elasticity=.4; static XYZ bounceness; static float frictionness; static float closestdistance; static float distance; static XYZ point[3]; static XYZ closestpoint; static XYZ closestswordpoint; static XYZ extramove; static float tempmult; if(owner!=-1) { oldowner=owner; } if(damage>=2 && type==staff && owner!=-1) { // the staff breaks emit_sound_at(staffbreaksound, tippoint); XYZ tempvel; for(int j=0;j<40;j++) { tempvel.x=float(abs(Random()%100)-50)/20; tempvel.y=float(abs(Random()%100)-50)/20; tempvel.z=float(abs(Random()%100)-50)/20; Sprite::MakeSprite(splintersprite, position+(tippoint-position)*((float)j-8)/32,tempvel*.5, 115/255,73/255,12/255, .1, 1); } if(owner!=-1) { player[owner].weaponactive=-1; player[owner].num_weapons--; if(player[owner].num_weapons) { player[owner].weaponids[0]=player[owner].weaponids[player[owner].num_weapons]; if(player[owner].weaponstuck==player[owner].num_weapons) player[owner].weaponstuck=0; } } owner=-1; hitsomething=0; missed=1; freetime=0; firstfree=1; position=0; physics=0; } oldposition=position; oldtippoint=tippoint; if(owner==-1 && (velocity.x||velocity.y||velocity.z) && !physics) { // if the weapon is flying position+=velocity*multiplier; tippoint+=velocity*multiplier; whichpatchx=position.x/(terrain.size/subdivision*terrain.scale); whichpatchz=position.z/(terrain.size/subdivision*terrain.scale); if(whichpatchx>0 && whichpatchz>0 && whichpatchxtemppoint2.x) rotation1=360-rotation1; rotation3=0; smallrotation=90; smallrotation2=0; bigtilt=0; bigtilt2=0; bigrotation=0; emit_sound_at(knifesheathesound, position, 128.); bloody=0; Sprite::MakeSprite(cloudimpactsprite, position,velocity, 1,1,1, .8, .3); } else { physics=1; firstfree=1; position-=velocity*multiplier; tippoint-=velocity*multiplier; tipvelocity=velocity; } } } } } if(velocity.x||velocity.y||velocity.z) { for(int j=0;j0){ player[j].weaponids[player[j].num_weapons]=player[j].weaponids[0]; } player[j].num_weapons++; player[j].weaponids[0]=i; player[j].aitype=attacktypecutoff; } else { if(j!=0) numthrowkill++; player[j].num_weapons++; player[j].weaponstuck=player[j].num_weapons-1; if(normaldotproduct(player[j].facing,velocity)>0) player[j].weaponstuckwhere=1; else player[j].weaponstuckwhere=0; player[j].weaponids[player[j].num_weapons-1]=i; player[j].RagDoll(0); player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].velocity+=velocity*2; player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].velocity+=velocity*2; player[j].skeleton.joints[player[j].skeleton.jointlabels[rightshoulder]].velocity+=velocity*2; player[j].skeleton.joints[player[j].skeleton.jointlabels[leftshoulder]].velocity+=velocity*2; if(bloodtoggle&&tutoriallevel!=1) Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); if(tutoriallevel==1) Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3); footvel=tippoint-position; Normalise(&footvel); if(bloodtoggle&&tutoriallevel!=1) Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1); if(tutoriallevel!=1) { if(player[j].weaponstuckwhere==0) player[j].DoBloodBig(2,205); if(player[j].weaponstuckwhere==1) player[j].DoBloodBig(2,200); player[j].damage+=200/player[j].armorhigh; player[j].deathbleeding=1; player[j].bloodloss+=(200+abs((float)(Random()%40))-20)/player[j].armorhigh; owner=j; bloody=2; blooddrip=5; } emit_sound_at(fleshstabsound, position, 128.); if(animation[player[0].targetanimation].height==highheight) award_bonus(0, ninja); else award_bonus(0, Bullseyebonus); } } else missed=1; } } } if(position.ytemppoint2.x) rotation1=360-rotation1; } } //Sword physics XYZ mid; XYZ oldmid; XYZ oldmid2; tempmult=multiplier; multiplier/=10; for(int l=0;l<10;l++) { if(owner==-1&&(velocity.x||velocity.y||velocity.z)&&physics) { //move position+=velocity*multiplier; tippoint+=tipvelocity*multiplier; //Length constrain midp=(position*mass+tippoint*tipmass)/(mass+tipmass); vel=tippoint-midp; Normalise(&vel); newpoint1=midp-vel*length*(tipmass/(mass+tipmass)); newpoint2=midp+vel*length*(mass/(mass+tipmass)); if(!freeze){ if(freetime>.04) { velocity=velocity+(newpoint1-position)/multiplier; tipvelocity=tipvelocity+(newpoint2-tippoint)/multiplier; } } position=newpoint1; tippoint=newpoint2; //Object collisions whichpatchx=(position.x)/(terrain.size/subdivision*terrain.scale); whichpatchz=(position.z)/(terrain.size/subdivision*terrain.scale); if(whichpatchx>0&&whichpatchz>0&&whichpatchx0)velocity*=1-friction*frictionness; else velocity=0; velocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1) { int whichsound; if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, position, 128*findLengthfast(&bounceness)); } } start=oldtippoint; end=tippoint; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); if(whichhit!=-1) { hitsomething=1; tippoint=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; ReflectVector(&tipvelocity,&terrainnormal); tippoint+=terrainnormal*.002; bounceness=terrainnormal*findLength(&tipvelocity)*(abs(normaldotproduct(tipvelocity,terrainnormal))); if(findLengthfast(&tipvelocity)0)tipvelocity*=1-friction*frictionness; else tipvelocity=0; tipvelocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, position, 128*findLengthfast(&bounceness)); } } if((objects.type[k]!=boxtype && objects.type[k]!=platformtype && objects.type[k]!=walltype && objects.type[k]!=weirdtype)||objects.rotation2[k]!=0) for(int m=0;m<2;m++){ mid=(position*(21+(float)m*10)+tippoint*(19-(float)m*10))/40; oldmid2=mid; oldmid=(oldposition*(21+(float)m*10)+oldtippoint*(19-(float)m*10))/40; start=oldmid; end=mid; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); if(whichhit!=-1) { hitsomething=1; mid=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; ReflectVector(&velocity,&terrainnormal); bounceness=terrainnormal*findLength(&velocity)*(abs(normaldotproduct(velocity,terrainnormal))); if(findLengthfast(&velocity)0)velocity*=1-friction*frictionness; else velocity=0; velocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, mid, 128*findLengthfast(&bounceness)); } position+=(mid-oldmid2)*(20/(1+(float)m*10)); } mid=(position*(19-(float)m*10)+tippoint*(21+(float)m*10))/40; oldmid2=mid; oldmid=(oldposition*(19-(float)m*10)+oldtippoint*(21+(float)m*10))/40; start=oldmid; end=mid; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); if(whichhit!=-1) { hitsomething=1; mid=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; ReflectVector(&tipvelocity,&terrainnormal); bounceness=terrainnormal*findLength(&tipvelocity)*(abs(normaldotproduct(tipvelocity,terrainnormal))); if(findLengthfast(&tipvelocity)0)tipvelocity*=1-friction*frictionness; else tipvelocity=0; tipvelocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, mid, 128*findLengthfast(&bounceness)); } tippoint+=(mid-oldmid2)*(20/(1+(float)m*10)); } } else { start=position; end=tippoint; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); if(whichhit!=-1) { hitsomething=1; closestdistance=-1; closestswordpoint=colpoint;//(position+tippoint)/2; point[0]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[0]],0,objects.rotation[k],0)+objects.position[k]; point[1]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[1]],0,objects.rotation[k],0)+objects.position[k]; point[2]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[2]],0,objects.rotation[k],0)+objects.position[k]; if(DistancePointLine(&closestswordpoint, &point[0], &point[1], &distance,&colpoint )) { if(distance0)velocity*=1-friction*frictionness; else velocity=0; if(terrain.getOpacity(position.x,position.z)<.2)velocity+=bounceness*elasticity*.3; else velocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1) { int whichsound; if(terrain.getOpacity(position.x,position.z)>.2){ if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); } else { whichsound=footstepsound+abs(Random()%2); } emit_sound_at(whichsound, position, findLengthfast(&bounceness) * (terrain.getOpacity(position.x,position.z) > .2 ? 128. : 32.)); if(terrain.getOpacity(position.x,position.z)<.2) { XYZ terrainlight; terrainlight=terrain.getLighting(position.x,position.z); if(environment==snowyenvironment){ if(findDistancefast(&position,&viewer)0)tipvelocity*=1-friction*frictionness; else tipvelocity=0; if(terrain.getOpacity(tippoint.x,tippoint.z)<.2)tipvelocity+=bounceness*elasticity*.3; else tipvelocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(terrain.getOpacity(tippoint.x,tippoint.z)>.2){ if(type==staff) whichsound=footstepsound3+abs(Random()%2); else whichsound=clank1sound+abs(Random()%4); } else { whichsound=footstepsound+abs(Random()%2); } emit_sound_at(whichsound, tippoint, findLengthfast(&bounceness) * (terrain.getOpacity(tippoint.x,tippoint.z) > .2 ? 128. : 32.)); if(terrain.getOpacity(tippoint.x,tippoint.z)<.2) { XYZ terrainlight; terrainlight=terrain.getLighting(tippoint.x,tippoint.z); if(environment==snowyenvironment){ if(findDistancefast(&tippoint,&viewer)0)velocity*=1-friction*frictionness; else velocity=0; if(terrain.getOpacity(mid.x,mid.z)<.2)velocity+=bounceness*elasticity*.3; else velocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(terrain.getOpacity(mid.x,mid.z)>.2){ if(type==staff)whichsound=footstepsound3+abs(Random()%2); if(type!=staff)whichsound=clank1sound+abs(Random()%4); } else whichsound=footstepsound+abs(Random()%2); emit_sound_at(whichsound, mid, findLengthfast(&bounceness) * (terrain.getOpacity(position.x,position.z) > .2 ? 128. : 32.)); } position+=(mid-oldmid)*20; } mid=position+tippoint; mid/=2; mid+=(tippoint-mid)/20; oldmid=mid; if(mid.y0)tipvelocity*=1-friction*frictionness; else tipvelocity=0; if(terrain.getOpacity(mid.x,mid.z)<.2)tipvelocity+=bounceness*elasticity*.3; else tipvelocity+=bounceness*elasticity; if(findLengthfast(&bounceness)>1){ int whichsound; if(terrain.getOpacity(mid.x,mid.z)>.2){ if(type==staff)whichsound=footstepsound3+abs(Random()%2); if(type!=staff)whichsound=clank1sound+abs(Random()%4); } else whichsound=footstepsound+abs(Random()%2); emit_sound_at(whichsound, mid, findLengthfast(&bounceness) * (terrain.getOpacity(position.x,position.z) > .2 ? 128. : 32.)); } tippoint+=(mid-oldmid)*20; } //Gravity velocity.y+=gravity*multiplier; tipvelocity.y+=gravity*multiplier; //Rotation XYZ temppoint1,temppoint2,tempforward; float distance; temppoint1=position; temppoint2=tippoint; distance=findDistance(&temppoint1,&temppoint2); rotation2=asin((temppoint1.y-temppoint2.y)/distance); rotation2*=360/6.28; temppoint1.y=0; temppoint2.y=0; rotation1=acos((temppoint1.z-temppoint2.z)/findDistance(&temppoint1,&temppoint2)); rotation1*=360/6.28; rotation3=0; smallrotation=90; smallrotation2=0; bigtilt=0; bigtilt2=0; bigrotation=0; if(temppoint1.x>temppoint2.x)rotation1=360-rotation1; //Stop moving if(findLengthfast(&velocity)<.3&&findLengthfast(&tipvelocity)<.3&&hitsomething){ freetime+=multiplier; } if(freetime>.4){ velocity=0; tipvelocity=0; } firstfree=0; } } multiplier=tempmult; if(blooddrip && bloody) { blooddripdelay-=blooddrip*multiplier/2; blooddrip-=multiplier; if(blooddrip<0) blooddrip=0; if(blooddrip>5) blooddrip=5; if(blooddripdelay<0 && bloodtoggle) { blooddripdelay=1; XYZ bloodvel; XYZ bloodloc; bloodloc=position+(tippoint-position)*.7; bloodloc.y-=.05; if(bloodtoggle) { bloodvel=0; Sprite::MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1); } } } if(onfire) { flamedelay-=multiplier; if(onfire&&flamedelay<=0) { flamedelay=.020; flamedelay-=multiplier; normalrot=0; if(owner!=-1) { normalrot=player[owner].velocity; } normalrot.y+=1; if(owner!=-1) { if(player[owner].onterrain) { normalrot.y=1; } } Sprite::MakeSprite(weaponflamesprite, position+tippoint*(((float)abs(Random()%100))/600+.05),normalrot, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*1/3, 1); Sprite::setLastSpriteSpeed(4); Sprite::setLastSpriteAlivetime(.3); } } if(!onfire && owner==-1 && type!=staff) { flamedelay-=multiplier; if(flamedelay<=0) { flamedelay=.020; flamedelay-=multiplier; normalrot=0; if(Random()%50==0&&findDistancefast(&position,&viewer)>80) { XYZ shinepoint; shinepoint=position+(tippoint-position)*(((float)abs(Random()%100))/100); Sprite::MakeSprite(weaponshinesprite, shinepoint,normalrot, 1,1,1, (.1+(float)abs(Random()%100)/200-.25)*1/3*fast_sqrt(findDistance(&shinepoint,&viewer)), 1); Sprite::setLastSpriteSpeed(4); Sprite::setLastSpriteAlivetime(.3); } } } } void Weapons::DoStuff() { //Move int i = 0; for(std::vector::iterator weapon = begin(); weapon != end(); ++weapon) { weapon->DoStuff(i++); } } void Weapon::Draw() { static XYZ terrainlight; static GLfloat M[16]; if((frustum.SphereInFrustum(position.x,position.y,position.z,1)&& findDistancefast(&viewer,&position)1)|| (player[owner].currentanimation==staffhitreversedanim && player[owner].currentframe>1)|| (player[owner].currentanimation==staffspinhitanim && player[owner].currentframe>1)|| (player[owner].currentanimation==staffspinhitreversedanim && player[owner].currentframe>1)|| (player[owner].currentanimation==staffgroundsmashanim && player[owner].currentframe>1)|| (player[owner].targetanimation==swordslashanim && player[owner].targetframe<7)|| player[owner].targetanimation==crouchstabanim|| player[owner].targetanimation==swordslashreversalanim|| player[owner].targetanimation==swordslashreversedanim|| player[owner].targetanimation==knifefollowanim|| player[owner].targetanimation==swordgroundstabanim|| player[owner].targetanimation==knifethrowanim)&& player[owner].targetanimation==lastdrawnanim&& !player[owner].skeleton.free ) { drawhowmany=10; } else { drawhowmany=1; } if(player[owner].targetanimation==swordgroundstabanim) { lastdrawnrotation1=rotation1; lastdrawnrotation2=rotation2; lastdrawnrotation3=rotation3; lastdrawnbigrotation=bigrotation; lastdrawnbigtilt=bigtilt; lastdrawnbigtilt2=bigtilt2; lastdrawnsmallrotation=smallrotation; lastdrawnsmallrotation2=smallrotation2; } } if(draw) { terrainlight=terrain.getLighting(position.x,position.z); if(drawhowmany>0) { glAlphaFunc(GL_GREATER, 0.01); } for(int j=drawhowmany;j>0;j--) { glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glColor4f(terrainlight.x,terrainlight.y,terrainlight.z,j/drawhowmany); if(owner==-1) glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); else glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)-.02+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); glRotatef(bigrotation*(((float)(j))/drawhowmany)+lastdrawnbigrotation*(1-((float)(j))/drawhowmany),0,1,0); glRotatef(bigtilt2*(((float)(j))/drawhowmany)+lastdrawnbigtilt2*(1-((float)(j))/drawhowmany),1,0,0); glRotatef(bigtilt*(((float)(j))/drawhowmany)+lastdrawnbigtilt*(1-((float)(j))/drawhowmany),0,0,1); glRotatef(-rotation1*(((float)(j))/drawhowmany)-lastdrawnrotation1*(1-((float)(j))/drawhowmany)+90,0,1,0); glRotatef(-rotation2*(((float)(j))/drawhowmany)-lastdrawnrotation2*(1-((float)(j))/drawhowmany)+90,0,0,1); glRotatef(-rotation3*(((float)(j))/drawhowmany)-lastdrawnrotation3*(1-((float)(j))/drawhowmany),0,1,0); glRotatef(smallrotation*(((float)(j))/drawhowmany)+lastdrawnsmallrotation*(1-((float)(j))/drawhowmany),1,0,0); glRotatef(smallrotation2*(((float)(j))/drawhowmany)+lastdrawnsmallrotation2*(1-((float)(j))/drawhowmany),0,1,0); if(owner!=-1) { if(player[owner].targetanimation==staffhitanim||player[owner].currentanimation==staffhitanim||player[owner].targetanimation==staffhitreversedanim||player[owner].currentanimation==staffhitreversedanim) { glTranslatef(0,0,-.3); } if(player[owner].targetanimation==staffgroundsmashanim||player[owner].currentanimation==staffgroundsmashanim||player[owner].targetanimation==staffspinhitreversedanim||player[owner].currentanimation==staffspinhitreversedanim||player[owner].targetanimation==staffspinhitanim||player[owner].currentanimation==staffspinhitanim) { glTranslatef(0,0,-.1); } } glEnable(GL_LIGHTING); switch(type) { case knife: if(!bloody||!bloodtoggle) throwingknifemodel.drawdifftex(knifetextureptr); if(bloodtoggle) { if(bloody==1) throwingknifemodel.drawdifftex(lightbloodknifetextureptr); if(bloody==2) throwingknifemodel.drawdifftex(bloodknifetextureptr); } break; case sword: if(!bloody||!bloodtoggle) swordmodel.drawdifftex(swordtextureptr); if(bloodtoggle) { if(bloody==1) swordmodel.drawdifftex(lightbloodswordtextureptr); if(bloody==2) swordmodel.drawdifftex(bloodswordtextureptr); } break; case staff: staffmodel.drawdifftex(stafftextureptr); break; } glPopMatrix(); } lastdrawnposition=position; lastdrawntippoint=tippoint; lastdrawnrotation1=rotation1; lastdrawnrotation2=rotation2; lastdrawnrotation3=rotation3; lastdrawnbigrotation=bigrotation; lastdrawnbigtilt=bigtilt; lastdrawnbigtilt2=bigtilt2; lastdrawnsmallrotation=smallrotation; lastdrawnsmallrotation2=smallrotation2; if(owner!=-1)lastdrawnanim=player[owner].currentanimation; } if(owner!=-1) { glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glLoadIdentity(); glTranslatef(position.x,position.y-.02,position.z); glRotatef(bigrotation,0,1,0); glRotatef(bigtilt2,1,0,0); glRotatef(bigtilt,0,0,1); glRotatef(-rotation1+90,0,1,0); glRotatef(-rotation2+90,0,0,1); glRotatef(-rotation3,0,1,0); glRotatef(smallrotation,1,0,0); glRotatef(smallrotation2,0,1,0); glTranslatef(0,0,length); glGetFloatv(GL_MODELVIEW_MATRIX,M); tippoint.x=M[12]; tippoint.y=M[13]; tippoint.z=M[14]; glPopMatrix(); } } } int Weapons::Draw() { glAlphaFunc(GL_GREATER, 0.9); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); glDepthMask(1); for(std::vector::iterator weapon = begin(); weapon != end(); ++weapon) { weapon->Draw(); } return 0; } Weapons::Weapons() { } Weapons::~Weapons() { if (Weapon::stafftextureptr) glDeleteTextures( 1, &Weapon::stafftextureptr ); if (Weapon::knifetextureptr) glDeleteTextures( 1, &Weapon::knifetextureptr ); if (Weapon::lightbloodknifetextureptr) glDeleteTextures( 1, &Weapon::lightbloodknifetextureptr ); if (Weapon::bloodknifetextureptr) glDeleteTextures( 1, &Weapon::bloodknifetextureptr ); if (Weapon::swordtextureptr) glDeleteTextures( 1, &Weapon::swordtextureptr ); if (Weapon::lightbloodswordtextureptr) glDeleteTextures( 1, &Weapon::lightbloodswordtextureptr ); if (Weapon::bloodswordtextureptr) glDeleteTextures( 1, &Weapon::bloodswordtextureptr ); } lugaru-0~20110520.1+hge4354.orig/Source/MacCompatibility.cpp0000644000000000000000000001574611571222446021615 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if !PLATFORM_MACOSX /**> HEADER FILES <**/ #include "MacCompatibility.h" #ifdef WIN32 #include #endif #include #include #include #include #include #if PLATFORM_UNIX #include #include #include #include typedef long long __int64; typedef __int64 LARGE_INTEGER; static int QueryPerformanceFrequency(LARGE_INTEGER *liptr) { assert(sizeof (__int64) == 8); assert(sizeof (LARGE_INTEGER) == 8); *liptr = 1000; return(1); } static int QueryPerformanceCounter(LARGE_INTEGER *liptr) { struct timeval tv; gettimeofday(&tv, NULL); *liptr = ( (((LARGE_INTEGER) tv.tv_sec) * 1000) + (((LARGE_INTEGER) tv.tv_usec) / 1000) ); return(1); } #endif class AppTime { public: AppTime() { counterRate = 1; baseCounter = 0; QueryPerformanceFrequency( (LARGE_INTEGER*)&counterRate); QueryPerformanceCounter( (LARGE_INTEGER*)&baseCounter); } __int64 counterRate; // LARGE_INTEGER type has no math functions so use int64 __int64 baseCounter; }; static AppTime g_appTime; void CopyCStringToPascal( const char* src, unsigned char dst[256]) { int len = strlen( src); dst[ 0] = len; memcpy( dst + 1, src, len); } void CopyPascalStringToC( const unsigned char* src, char* dst) { int len = src[ 0]; memcpy( dst, src + 1, len); dst[ len] = 0; } AbsoluteTime UpTime() { __int64 counter; QueryPerformanceCounter( (LARGE_INTEGER*)&counter); counter -= g_appTime.baseCounter; AbsoluteTime time; time.lo = (unsigned long)counter; time.hi = (unsigned long)(counter >> 32); return time; } Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b) { __int64 value = a.hi; value <<= 32; value |= a.lo; __int64 value2 = b.hi; value2 <<= 32; value2 |= b.lo; value -= value2; if (value <= 0) return durationImmediate; __int64 frac = value % g_appTime.counterRate; value /= g_appTime.counterRate; Duration time; if (value == 0) { frac *= -1000000; frac /= g_appTime.counterRate; time = (Duration)frac; } else { frac *= 1000; frac /= g_appTime.counterRate; value *= 1000; value += frac; time = (Duration)value; } return time; } #if PLATFORM_UNIX #include #include #include #include #include // some but not all of this is code from PhysicsFS: http://icculus.org/physfs/ // the zlib license on physfs allows this cut-and-pasting. static int locateOneElement(char *buf) { char *ptr; char **rc; char **i; DIR *dirp; //if (PHYSFS_exists(buf)) if (access(buf, F_OK) == 0) return(1); /* quick rejection: exists in current case. */ ptr = strrchr(buf, '/'); /* find entry at end of path. */ if (ptr == NULL) { dirp = opendir("."); ptr = buf; } /* if */ else { *ptr = '\0'; dirp = opendir(buf); *ptr = '/'; ptr++; /* point past dirsep to entry itself. */ } /* else */ struct dirent *dent; while ((dent = readdir(dirp)) != NULL) { if (strcasecmp(dent->d_name, ptr) == 0) { strcpy(ptr, dent->d_name); /* found a match. Overwrite with this case. */ closedir(dirp); return(1); } /* if */ } /* for */ /* no match at all... */ closedir(dirp); return(0); } /* locateOneElement */ static inline const char *getUserDirByUID(void) { struct passwd *pw = getpwuid(getuid()); if (pw != NULL) return(pw->pw_dir); return(NULL); } /* getUserDirByUID */ static inline const char *getPrefPath(void) { static char *prefpath = NULL; if (prefpath == NULL) { const char *homedir = getenv("HOME"); if (homedir == NULL) homedir = getUserDirByUID(); if (homedir == NULL) homedir = "."; // oh well. #if (defined(__APPLE__) && defined(__MACH__)) const char *PREFPATHNAME = "Library/Application Support/Lugaru"; #else const char *PREFPATHNAME = ".lugaru"; #endif size_t len = strlen(homedir) + strlen(PREFPATHNAME) + 2; prefpath = new char[len]; snprintf(prefpath, len, "%s/%s", homedir, PREFPATHNAME); } return(prefpath); } static int locateCorrectCase(char *buf, bool makedirs) { int rc; char *ptr; char *prevptr; ptr = prevptr = buf; while (ptr = strchr(ptr + 1, '/')) { *ptr = '\0'; /* block this path section off */ rc = locateOneElement(buf); if (!rc) { if (makedirs) /* normal if we're writing; build dirs! */ mkdir(buf, S_IRWXU); else { *ptr = '/'; /* restore path separator */ return(-2); /* missing element in path. */ } /* else */ } /* if */ *ptr = '/'; /* restore path separator */ } /* while */ /* check final element... */ return(locateOneElement(buf) ? 0 : -1); } static int locateCorrectFile(char *buf, const char *mode) { if (*buf == '\0') return(0); /* Uh...I guess that's failure. */ assert((mode[0] == 'w') || (mode[0] == 'r')); bool iswriting = (mode[0] == 'w'); const char *prefpath = getPrefPath(); size_t len = strlen(buf) + strlen(prefpath) + 2; char *prefpathfile = (char *) alloca(len); snprintf(prefpathfile, len, "%s/%s", prefpath, buf); int rc = locateCorrectCase(prefpathfile, iswriting); /* favor prefpath. */ if ( (rc == 0) || ((rc == -1) && (iswriting)) ) // found or create? strcpy(buf, prefpathfile); else if ((rc < 0) && (!iswriting)) /* not writing? Try game dir... */ rc = locateCorrectCase(buf, iswriting); return(rc); } /* locateCorrectFile */ #endif static char g_filename[4096]; char* ConvertFileName( const char* orgfilename, const char *mode) { if (orgfilename == g_filename) // recursion? return g_filename; // translate filename into proper path name if (orgfilename[ 0] == ':') orgfilename++; strcpy( g_filename, orgfilename); for (int n = 0; g_filename[ n]; n++) { if (g_filename[ n] == ':') g_filename[ n] = '/'; else if (g_filename[ n] == '\\') g_filename[ n] = '/'; } #if PLATFORM_UNIX locateCorrectFile(g_filename, mode); #endif return g_filename; } #endif lugaru-0~20110520.1+hge4354.orig/Source/Text.h0000644000000000000000000000360111571222446016737 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _TEXT_H_ #define _TEXT_H_ /**> HEADER FILES <**/ #include "Quaternions.h" //#include "Files.h" #include "Quaternions.h" #include "gamegl.h" #include "TGALoader.h" class Text{ public: GLuint FontTexture; GLuint base; void LoadFontTexture(const char *fileName); void BuildFont(); void glPrint(float x, float y, const char *string, int set, float size, float width, float height); void glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height); void glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end); void glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height,int start,int end); void glPrintOutlined(float x, float y, const char *string, int set, float size, float width, float height); void glPrintOutlined(float r, float g, float b, float x, float y, const char *string, int set, float size, float width, float height); Text(); ~Text(); private: void _glPrint(float x, float y, const char *string, int set, float size, float width, float height, int start, int end, int offset); }; #endif lugaru-0~20110520.1+hge4354.orig/Source/Person.h0000644000000000000000000002054411571222446017266 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PERSON_H_ #define _PERSON_H_ /**> HEADER FILES <**/ #include "gamegl.h" #include "Quaternions.h" #include "Skeleton.h" #include "Models.h" #include "Terrain.h" #include "Sprite.h" #include #include "Weapons.h" #include "Animation.h" #define passivetype 0 #define guardtype 1 #define searchtype 2 #define attacktype 3 #define attacktypecutoff 4 #define playercontrolled 5 #define gethelptype 6 #define getweapontype 7 #define pathfindtype 8 #define rabbittype 0 #define wolftype 1 class Person { public: int whichpatchx; int whichpatchz; int currentframe; int targetframe; int currentanimation; int targetanimation; int oldcurrentframe; int oldtargetframe; int oldcurrentanimation; int oldtargetanimation; int howactive; float parriedrecently; bool superruntoggle; int lastattack,lastattack2,lastattack3; XYZ currentoffset,targetoffset,offset; float target; float transspeed; XYZ realoldcoords; XYZ oldcoords; XYZ coords; XYZ originalcoords; XYZ velocity; XYZ proportionhead; XYZ proportionlegs; XYZ proportionarms; XYZ proportionbody; float heightleft; float heightright; float unconscioustime; bool immobile; float velspeed; float targetrotation; float targetrot; float rot; float oldrot; float lookrotation; float lookrotation2; float rotation; float rotation2; float lowrotation; float tilt; float targettilt; float tilt2; float targettilt2; bool rabbitkickenabled; float bloodloss; float bleeddelay; float skiddelay; float skiddingdelay; float deathbleeding; float tempdeltav; float damagetolerance; float damage; float permanentdamage; float superpermanentdamage; float lastcollide; int dead; float jumppower; bool onground; int madskills; int wentforweapon; bool calcrot; bool backwardsanim; XYZ facing; float bleeding; float bleedx,bleedy; int direction; float texupdatedelay; float headrotation,headrotation2; float targetheadrotation,targetheadrotation2; bool onterrain; bool pause; float grabdelay; Person *victim; bool hasvictim; float updatedelay; float normalsupdatedelay; bool jumpstart; bool forwardkeydown; bool forwardstogglekeydown; bool rightkeydown; bool leftkeydown; bool backkeydown; bool jumpkeydown; bool jumptogglekeydown; bool crouchkeydown; bool crouchtogglekeydown; bool drawkeydown; bool drawtogglekeydown; bool throwkeydown; bool throwtogglekeydown; bool attackkeydown; bool feint; bool lastfeint; bool headless; float crouchkeydowntime; float jumpkeydowntime; bool freefall; float turnspeed; int aitype; float aiupdatedelay; float losupdatedelay; int ally; XYZ movetarget; float collide; float collided; float avoidcollided; bool loaded; bool whichdirection; float whichdirectiondelay; bool avoidsomething; XYZ avoidwhere; float blooddimamount; float staggerdelay; float blinkdelay; float twitchdelay; float twitchdelay2; float twitchdelay3; float lefthandmorphness; float righthandmorphness; float headmorphness; float chestmorphness; float tailmorphness; float targetlefthandmorphness; float targetrighthandmorphness; float targetheadmorphness; float targetchestmorphness; float targettailmorphness; int lefthandmorphstart,lefthandmorphend; int righthandmorphstart,righthandmorphend; int headmorphstart,headmorphend; int chestmorphstart,chestmorphend; int tailmorphstart,tailmorphend; float weaponmissdelay; float highreversaldelay; float lowreversaldelay; float nocollidedelay; int creature; int id; Skeleton skeleton; float speed; float scale; float power; float speedmult; float protectionhead; float protectionhigh; float protectionlow; float armorhead; float armorhigh; float armorlow; bool metalhead; bool metalhigh; bool metallow; int numclothes; char clothes[10][256]; float clothestintr[10]; float clothestintg[10]; float clothestintb[10]; bool landhard; bool bled; bool spurt; bool onfire; float onfiredelay; float burnt; float fireduration; float flamedelay; float updatestuffdelay; int playerdetail; int num_weapons; int weaponids[4]; int weaponactive; int weaponstuck; int weaponstuckwhere; int weaponwhere; int numwaypoints; XYZ waypoints[90]; int waypointtype[90]; float pausetime; bool hastempwaypoint; XYZ tempwaypoint; XYZ headtarget; float interestdelay; XYZ finalfinaltarget; XYZ finaltarget; int finalpathfindpoint; int targetpathfindpoint; int lastpathfindpoint; int lastpathfindpoint2; int lastpathfindpoint3; int lastpathfindpoint4; bool onpath; int waypoint; bool jumppath; XYZ lastseen; float lastseentime; float lastchecktime; float stunned; float surprised; float runninghowlong; int lastoccluded; int laststanding; int escapednum; float speechdelay; float neckspurtdelay; float neckspurtparticledelay; float neckspurtamount; int whichskin; bool rabbitkickragdoll; XYZ averageloc; XYZ oldaverageloc; Animation tempanimation; float occluded; void CheckKick(); void CatchFire(); void DoBlood(float howmuch, int which); void DoBloodBig(float howmuch, int which); bool DoBloodBigWhere(float howmuch, int which, XYZ where); bool wasIdle() { return animation_bits[currentanimation] & ab_idle; } bool isIdle() { return animation_bits[targetanimation] & ab_idle; } int getIdle(); bool isSitting() { return animation_bits[targetanimation] & ab_sit; } bool isSleeping() { return animation_bits[targetanimation] & ab_sleep; } bool wasCrouch() { return animation_bits[currentanimation] & ab_crouch; } bool isCrouch() { return animation_bits[targetanimation] & ab_crouch; } int getCrouch(); bool wasStop() { return animation_bits[currentanimation] & ab_stop; } bool isStop() { return animation_bits[targetanimation] & ab_stop; } int getStop(); bool wasSneak(); bool isSneak(); int getSneak(); bool wasRun() { return animation_bits[currentanimation] & ab_run; } bool isRun() { return animation_bits[targetanimation] & ab_run; } int getRun(); bool wasLanding() { return animation_bits[currentanimation] & ab_land; } bool isLanding() { return animation_bits[targetanimation] & ab_land; } int getLanding(); bool wasLandhard() { return animation_bits[currentanimation] & ab_landhard; } bool isLandhard() { return animation_bits[targetanimation] & ab_landhard; } int getLandhard(); bool wasFlip() { return animation_bits[currentanimation] & ab_flip; } bool isFlip() { return animation_bits[targetanimation] & ab_flip; } bool jumpclimb; bool isWallJump() { return animation_bits[targetanimation] & ab_walljump; } void Reverse(); void DoDamage(float howmuch); void DoHead(); void DoMipmaps() { glBindTexture(GL_TEXTURE_2D, skeleton.drawmodel.textureptr); gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, skeleton.skinsize, skeleton.skinsize, GL_RGB, GL_UNSIGNED_BYTE, &skeleton.skinText[0]); } int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model); int DrawSkeleton(); void Puff(int whichlabel); void FootLand(int which, float opacity); void DoStuff(); Joint& getJointFor(int); void setAnimation(int); void DoAnimations(); void RagDoll(bool checkcollision); }; const int maxplayers = 10; extern Person player[maxplayers]; #endif lugaru-0~20110520.1+hge4354.orig/Source/Lights.h0000644000000000000000000000254711571222446017255 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LIGHTS_H_ #define _LIGHTS_H_ /**> HEADER FILES <**/ #include "gamegl.h" #include "Quaternions.h" class Light{ public: GLint type; GLfloat color[3]; GLfloat ambient[3]; int attach; XYZ location; inline void setColors(GLfloat cr, GLfloat cg, GLfloat cb, GLfloat ar, GLfloat ag, GLfloat ab){ color[0]=cr; color[1]=cg; color[2]=cb; ambient[0]=ar; ambient[1]=ag; ambient[2]=ab; } }; void SetUpMainLight(Light* whichsource, int whichlight, float ambientr, float ambientg, float ambientb); void SetUpLight(Light* whichsource, int whichlight); #endif lugaru-0~20110520.1+hge4354.orig/Source/unpack.c0000644000000000000000000000647511571222446017303 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "binio.h" #include "private.h" struct BinIOUnpackContext { const uint8_t *data; va_list args; }; static void BinIOUnpack(void *context, int type, int byte_order, int count) { struct BinIOUnpackContext *ctx = (struct BinIOUnpackContext*)context; if (count == -1) { count = 1; } switch (type) { case BinIO_TYPE_IGNORE_BYTE: ctx->data += 1 * count; break; case BinIO_TYPE_BYTE: BinIOConvert1(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 1 * count; break; case BinIO_TYPE_INT16: BinIOConvert2(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 2 * count; break; case BinIO_TYPE_INT32: BinIOConvert4(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 4 * count; break; case BinIO_TYPE_INT64: BinIOConvert8(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 8 * count; break; case BinIO_TYPE_FLOAT32: BinIOConvert4(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 4 * count; break; case BinIO_TYPE_FLOAT64: BinIOConvert8(byte_order, BinIO_HOST_BYTE_ORDER, ctx->data, va_arg(ctx->args, uint8_t *), count); ctx->data += 8 * count; break; } } void unpackf(const char *format, ...) { va_list args; va_start(args, format); vfunpackf(stdin, format, args); va_end(args); } void sunpackf(const void *buffer, const char *format, ...) { va_list args; va_start(args, format); vsunpackf(buffer, format, args); va_end(args); } void funpackf(FILE *file, const char *format, ...) { va_list args; va_start(args, format); vfunpackf(file, format, args); va_end(args); } void vsunpackf(const void *buffer, const char *format, va_list args) { struct BinIOFormatCursor cursor; struct BinIOUnpackContext context; BinIOInitFormatCursor(&cursor, format); context.data = (const unsigned char*)buffer; va_copy(context.args, args); while (BinIONextChar(&context, &cursor, BinIOUnpack)) {} va_end(context.args); } void vfunpackf(FILE *file, const char *format, va_list args) { size_t n_bytes = BinIOFormatByteCount(format); void* buffer = malloc(n_bytes); fread(buffer, n_bytes, 1, file); vsunpackf(buffer, format, args); free(buffer); } lugaru-0~20110520.1+hge4354.orig/Source/win-res/0000755000000000000000000000000011571222446017226 5ustar rootrootlugaru-0~20110520.1+hge4354.orig/Source/win-res/Lugaru.rc0000644000000000000000000000307611571222446021021 0ustar rootroot// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_LUGARU ICON "lugaru.ico" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED lugaru-0~20110520.1+hge4354.orig/Source/win-res/Lugaru.png0000644000000000000000000007363211571222446021206 0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늫7![9u x ?u͏t/'Ck9;n],`TG)P)*sGBNtsչRKg77|: !w7de[1 #4'6ǫS.M9WY+4@G|4a݄pb8nb5֢k]Lmd+lP0&3qXT֯WrOv4ٽ`Ӿ ޤM`3l*vtt/No=A`?<SR|LIENDB`lugaru-0~20110520.1+hge4354.orig/Source/win-res/lugaru.ico0000644000000000000000000006117611571222446021234 0ustar rootroot 00h ( 00 h^"00 %'  nM h^(0`wpqw@48w5%47t7u7su47vRupswswSxAp@su77Spvvt0su7sV7GCwwsp07wGwwvpdvvRQ7w7A w|wG7swss@`XxvvpggvwSwsws'xhF\w77w55axwvEgxwqgw0@xxxwpdvwswswwpxgtVwwusu7sw7xxwhDe|xv56SSsw xx||tFVxxwW577W7xxwgDgwcSu775qhȈxltpGwxxwt7'CSRr@W|pdwwwCWSse7Sxxxv@tGhȌtw777pwrgxpDwxe%4supp1wqxxw|wtFVwasCVqF5$HxggDegxxe565wxgqwwwttw|GqachupG6PGwxwwgdglvSsSVwR7|vveGtTwvu%7pqawwqaaa`gv|ttwtFDtCRqrRwwg7egFFHDD457g|vu0qactdttP@@CW||gpqaa`FVFV`@@RRRV|wgG565eEepppqpefeeepqp0d$d@q1ae%GEtvV7@VVp'GegGF5!C@wp%7ttdD%7@4@40RGGE%@gApCp5$FFR@`'R@peed@@CA@HPp4ed$A`p!$tD@@AV44qFD$  sWqa`@G@A@`ACA ptF@@`@@d0gp@$@F0p@@Dd@Ac@xwwggw???( @pppu4 ssWd50'7W78GsstupvvSwsqwwvw57w7%ǀVwg77u7wFWwu5w7wvGgw77sp`}|wFwwSWq|pGwwcssw$xxxx`wxȆHxw@tgtwqw%rwDVqpwwW4tgw50wt5sGxhwFWwsRwwqw|etgpu4xwCG4gGtFV7|wpqategDaapvwlqrSDGFPCGvs0dp`44tteGPPeppeee'@FCqadtCRPpRA4VFP@$GDRpqpFB@0cS@TB%`p@w@@Pa!`p@@@`GGpwP??( p7pu7WpwxGswvwu7pxv7pxWwuqphFsw'Vvew4pp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/n:)j7'm9,r;02ǵ;':>H7?K"*,8H2@SDOdDFT;5;p;1I<}H;|H9L=~K:ZJJFWl9GY>K^7=J.0://9'&-G#Z+d2%m8-w=4wbas >GS %,"(3B1>PGPa?COE))s6.G;H>zD:p?1q?1P=HW8?K*,4/2;.1;@!J"N$]-"|s .'+7:B )0:JCGU58B\#}@0G6u91d2(V+O&B*'Qcv9CP4=I3:E$'.07A17A3?AL# |sr_=>F ,3?58C0&)x=-~E3}B0r3'\(!L"A0FSc5=I$)1!' (.738A+ 89y_G")  /3<(,4J+!z@-u8$d$IB71 ) 8>J$)0!%,7  %&*IJS sdcs)11= H 7 7 C RH\I#!67@JO\Gih2C*)s( " . <;Ai74sxs2,D??(  @ qv#%+$*26K%HXiUh|QbtM[lzd_@GDKESeAP_"(djt{|wyjbmtO9gULZmRkcNcv6@LUIFʭznZ͵ |0$cQ~\jzL]oVpWr*09 #ŪǪn^H SPA0twsvL]oL^nOarL\m!#(ɬĤzbPvkdŚfTtqKYkL\oM^pIXi4:DUIFȮȬwfK>_ YH|DIWHQaPXh|DDLKVg@FRjYTåwfRCw1^M{pQNVJ\tAFUWOTqp9?MLVh.+1wgnZUDF:Z eJ)':DT?QgBESwXSqbhXAJYBM_;?MA+&|C+s<(o;-xJI*68A(1?:G[AAMxE:PAP?MP\4b4&LKS9CP.3=04>?N$о [Y] .2<[3)u9(V#=6/3%*2-2:/ piLNU"#'*).<-/j,Q / ' . -+0bMHugf$G @ (& Blko eKJ64 < QŅ]Ylhmlugaru-0~20110520.1+hge4354.orig/Source/win-res/resource.h0000644000000000000000000000066111571222446021231 0ustar rootroot//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Lugaru.rc // #define IDI_LUGARU 104 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif lugaru-0~20110520.1+hge4354.orig/Source/win-res/Untitled-1.jpg0000644000000000000000000003172311571222446021664 0ustar rootrootJFIFHH 1 256 128 1 72/1 72/1 2 2005-05-01T20:50:25-06:00 2005-05-01T20:50:25-06:00 2005-05-01T20:50:25-06:00 Adobe Photoshop CS Windows adobe:docid:photoshop:6eed8e4d-baac-11d9-91e6-9b2c15b8c568 image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km!Adobed@]  ?????????lugaru-0~20110520.1+hge4354.orig/Source/win-res/Lugaru.psd0000644000000000000000000033713111571222446021205 0ustar rootroot8BPSY08BIM%8BIM$ 1 128 128 1 72/1 72/1 2 2005-04-23T20:00:11-04:00 2005-04-23T20:00:11-04:00 2005-04-23T20:00:11-04:00 Adobe Photoshop CS Macintosh adobe:docid:photoshop:43ff171e-b5c4-11d9-aec1-f1368115a5ac application/vnd.adobe.photoshop 8BIM com.apple.print.PageFormat.PMHorizontalRes com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMHorizontalRes 72 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMOrientation com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMOrientation 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMScaling com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMScaling 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalRes com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalRes 72 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalScaling com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalScaling 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.subTicket.paper_info_ticket com.apple.print.PageFormat.PMAdjustedPageRect com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPageRect 0.0 0.0 734 576 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPaperRect com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPaperRect -18 -18 774 594 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMPaperName com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMPaperName na-letter com.apple.print.ticket.client com.apple.print.pm.PostScript com.apple.print.ticket.modDate 2003-07-01T17:49:36Z com.apple.print.ticket.stateFlag 1 com.apple.print.PaperInfo.PMUnadjustedPageRect com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPageRect 0.0 0.0 734 576 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPaperRect com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPaperRect -18 -18 774 594 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2005-04-23T23:57:51Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.ppd.PMPaperName com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.ppd.PMPaperName US Letter com.apple.print.ticket.client com.apple.print.pm.PostScript com.apple.print.ticket.modDate 2003-07-01T17:49:36Z com.apple.print.ticket.stateFlag 1 com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.privateLock com.apple.print.ticket.type com.apple.print.PaperInfoTicket com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.privateLock com.apple.print.ticket.type com.apple.print.PageFormatTicket 8BIMxHH@Rg(HH(dh 8BIMHH8BIM&?8BIM TransparencyAlpha 18BIM2 TransparencyAlpha 18BIMd28BIM8BIM x8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM@@8BIM8BIMI Untitled-1nullboundsObjcRct1Top longLeftlongBtomlongRghtlongslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM H HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km8BIM8BIM JFIFHH Adobe_CMAdobed            "?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?TQ}76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8BIM!SAdobe PhotoshopAdobe Photoshop CS8BIM".MM*bj(1r2iHHAdobe Photoshop CS Macintosh2005:04:23 20:00:11&(.HHg707T78BIMnorm((Layer 18BIMluniLayer 18BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp&   %6FT_gmqqmg_TF6% ,X ǢX,GEwسwEW؝W+ N= ={&z0~4#c pܿ Cý>3<ff  1BGA%!" 굟ү17:GlFQ;2 2 Zeڛ1@@ŗnn ߕ 11//$$zz ͍ MMWW؉EEwwه,,YYDž%م%77GGTT^^hhnnqqqqnnhh^^TTGG77%م%DžYY,,هwwEE؉WWMM ͍ zz$$//11 ߕ nnŗ@@›11ee   ɣ 2ץ2;;FFGG:ح:1ʯ1""  ff33CÿC pp ##4400&zz& NN W؝WEwسwE ,X ǢX,%6FT_gmqqmg_TF6%b*146@=DFEOSFJU]hflkmkkjpoqqoruqvxu|}{{{~~}~~}|{{~~~~}}}{yywwurspoomkigeca_\ZWURNMGEA=93-"'8 !"#$&'++,019BHKY_QGJJKIKNSSRVXVONTTMFED@;71+))())*+7  ?RV'   .'/U]\XQLHE:<>=LUD53+"       $B,   "S_*B)8R[dfO@GTX[\XYnyuin^gh[E'  #*  (<2 'Ya/C',?\`WXaR:./468@GDEOSXR_hfshF%    (   $ '=8 2cd3>'';QPWXUSK>' &+*),*,5DCHiqdG!     $A:  :if2;&.,DBIVUM@6&)>LN[cB"(()%    )J9" Atf2 A$'097>E<( &5>LfN!+,.*,)    .Q<(  Iwg/ F$ >7)-& ) #),:PL%&,+&%  2TB0%Oul2 B#=D*  + .=0/AE8 *($"  4XH6) Sqn2 =!0N3  ,OB,17?1&)(-)#   MG! #KP4,-86# *(.32,(#-   M_N<1'!!(`o\- =. BV6   BXC3.28((+*1201(   *\fSC7+&&$  -bq[2 ?9'TL)  9PE<32:2"132,(.0,*+& /`iWI>1+,'#! 2bp[6 =OEXC! 2QHF;48:&&=A;/.4422*%"" " 2djZQE:3/+($! 6enZ3 =R 3[[6 &&+NMJG87>0/CD;/.6;970(&&'&"?mm`YJB>70,)&" "  'WbO' ,3.E^KKC>=9$6A;1/5 :3**+-,& 'Vvpg]KFG>6/-**(+$" CgjV+ > E`cBT1>:>cUJNF>>/%23264+')*),,+*(!/axtm[IKKB<520745,*#!GglT* @-Wf\72DB=Z^LNLC?9%"-4<8+)*,1+)*)"3f{wqXIQNEC>::F>?41' #'IfoU+ A J^fU+#6HHATcTLPLAE3!&/;8540/5-..,'#  4k{rUISQHHFBCL@E;1)#&,LgpU,@  s~qRITSNNOGIN?I>2,$)1RfoR, $A OZ^X<P#1?FLNHSb]ZRORL?)#(--2FLE:;<;71**('"!#4R|dJMWSSWWMNO?IA3.%*1RbdQ.#%*?l EVX[U/"'6HMOPJPaeeZQXL?,"'./3:4/.,(  ##%&&7Y~XFRRPX]XPTR?HB21)*/H\WN3!$&,?l.TUX\G !'/:IPQRMMZef[RWPJ7% !(-0258=AC@>?=976/))+.12/++:Z|VFQRVX[RQUR>HC31+*/?VUH5 #%).Cm!LTRWV7"$*5AKQSQORZbk^QTWLB, "(-134688::?DCAAB<79<<:61.+:]~xTBQW\XUVYURAG?44.+2>MOG6  #&(+03B^ATOSZN/$(,8EKRTQPQ^\ilQMTME/#"'/238<:778=DB>>@@>ADD?642/AjtK?T\ZZVcZSUBG@35/05=GIO8 "$&)--04A):QRPWVD&$+/8FNRTSRM]e]sYNQOF6* &.59A;669<=CB<4644Mto=AWb]Y]hWSUAFE31145;FGG3 $')+.10155Bd :NQPQVP6 !+39FOTTSRMVp_i`TQPK8356<949AC?87;9>A>99<>46Bu|YCO[b`eafQTQ>DC87B528B@; "%)*),--373Cq%FOPPQRN9(+4:DPVWUTUSeveWRSNPMG9(+39:74248;=<9;>??@>==A>4@M|vXDQY_eo]eKTP?HC67:/5:>A= !##&)((*+.445433Cp 2INNMORI3,2:DPVXUSUT\opXMUNJPO=00586/2;?@=?BEFIIHD==>A;3Gbz}UEO]gnm]^NVT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AfL]sY1)>HQ^dgju||xri`SB8/$Xytqkfb]YQMIF@;8@  6IXit|rC*5HWQRot\_m\GQblhoy|~wdYdu}ygKNqlA(4DO]feiq{}yuogZD6,!)~zxtogc_XRLIC?:7?^ !7DM[jt|o2-;HRU]r}xppjWYenw{yyw}}uc=2[cK// 0CGO_pzh^(1BEQfmm~}urldpwyvvwqs~{tofcQ-':BP_ekv|}veL/ V{yuqlg`XTQMHB?=3< !6@GPasK(Qct{}^0CZceUTcu}yvvoliilnqlhmrqpompqorulkuwV2?wpnnha]WLHA;52.6 .=ITalt}5N(?I830,3 !8FLS\hu|9%"/Vlyvotummljllkllmlmnmjklommppkl_;)ytpje_XRNF<730*27 +9EQ]fpu{|~l"!OquuprtommlmnlkmDklnlknmoponrjWD-c|xsohb\SLFB<62.)2/ ->HOZdjov{}s:MqtppsromlmnomAlmqqoqm`mm\F4%?|xsplg`XLHC=92.)1) /;>BMXbhoux}~[OpuonmJlmnmmomnoppqrrqndhpl[?"&{wtpjb]YTKDA:5/)%,+ */6AJQZchlqzkKjsqppmlImnnmmlkotrnprnlgjqwk> `yuoga[VROHE@:3-'%)* #$+=OW[bilrx~wRMouzqmlInmnnlliorklnmjgchotmE <}xqjc\ZUNJEA=:2.*** "#):N]agkmt{|d4Wvpm#nmomknmkkmmimnkhfglgbfH !$yuoga[WQKEA><:61.,*  #(1DWainpu~uB:s}{unm(nompoonilpkpqnqsqojgjobUT: 4"{uqke_ZUOHDA?;;8420% ").=R`jtw{]>rypmKopolrrppkjqqwuxvwyqjmkZLE+ #}wpjgd_YTNIGB=:<=:4$ ")1@Ucmtw|o@asmnrpnlsuqlty{~}zol]K>:2 d!}vrlfb`XRNIDA;;AA?:#$+7GVbkorx{W@|qmMnoqooruwssuqw|~tlR9-,3- T~ytrlf_\XRNJFDBCD?:?8'/7FMU`fox|nHcysqnmmnppnotxxwvwyz~9xfF((30 D{wuofc_ZWTRRLIGFD?="(-5BHR[enw}nLr~{vommnonnvcF##3=1$`!}yvspkeaVOONJF@B>=E%!&').4:CMSZfqy{gEysnmmnJr}WLg/=9+!oyutple^WOLE?=;??>C#!$'(*,/6@IOVakt|~|u\^zpmnoJnvu4q| (:C8'!}{vokid`ZRJ>8<<;=@o #%&)*+/6=ELTblt|zyzxlSz}|sommnooqxu> )>DC6',~|wqkfa]YSF;9==<<  ! "%&(.6>DKUalrvtuupaVv|~uonlKory|Z: G[RI>/#F{wtohea\QJB;8865;"!!#'-7@FMT]ejmoppqZNhw|Ptomiikox~l^^J/-4F^nn^G3'"zzwrpjc\WUQKDA?94.&m!"%).6?GNUY^fkmmspNOp|y{{vnmgimr~|mimonlilqpkX=+B|xrkhibWROMLG?:6.('? "$'*,1:CJPRV`ijilVCcutw|xtspgjp}~{vuwxyyvuvhI2$(&t~{wrojdd]XTOJD?92.'.3!"$&(*-28?GLQZ]abYDTdkjxyv{ulmy1|rX<- C|xsokifb]XTTPJC<93'3.!#%&(+-/4=DHMSTUVOBRVYiy~{}wxw}dB0--#"r}xurmigca[WPMJHD;62"5D"$&'(*,06=AEGHJKLNA=IWjpglwy}~{ywrmnneO3&./&<|wsqkfgd^XSRMFB>72 ;e%')+*-1489;>AFHGNS17Odmlju~|s}piffe^UH2!#*46$s}xtnmjed_YTPPKA<71 A&(*--.157Z9=FLKOU2+Han{hgsf]VQI;,!(1:/?{yvsokhdaZVTMHA=;60!93)+-011479;;=GLNOP0$?YkxtWk{qfYL>0&,$//!vzxtrmidb^WSOHB<8753"+-/24459<>AEGJLO62Lcpw}oPVbo;~sg_TF6' @{wsplif^\XTPJDA:40,-02568:;<@SDHMC"+EZfmtxh@Grxi^VQF7+ [}xpojeb^ZWQMIE@;71(/0146889;==>=?BF4";T^emonQPdvqj[H?:6.$* Rsnu{yzxjagige`cjwxzxprpmif^WTOD?;963/)[235799:<>??<9@;-LX^efaLO\yvi\OF8-&  Fktpw~{oonrtlkj\SY_ORggdec`SLA6431-)Y35788:<>?>;:=;#"?RV^\QCERfomig^RG8-#  S{wvtu{}wwuvuv{zvrh[UQKPSTZTQK<3.-+C588;=<>?=?A@@7/BIQH>54=GMOLML@0%   -Wzx}~|~ywsojgdWJDKVO?,+$78:<;=>?@CBDC,*5;<7-(/466345(  By} ~}xvtsoj_SSYU,!89:;=?@@BBDFD4 $$&263)#(! -  4y|yxvx{z||}}zxutqjb`-9:;<=@CEFGG< 0AW\VC3512JG2  1i}zt{|{z~}{wsuv wvxzzyvsqn-;>??@BDCEFKM,K_isrligaUSF-  Jt~xqsussrrqpopquwxy.2:<>?@ABCEDJRMA5Ijzyz|ysfVA' Znp|}zwrooponnoppqqonlm.;==?@CDDB74Ux[1B_a_cc]UJ:# % Oipnq}y{z||{||zwsrrpmkjkllmllnop-/<>?@A@1';e~V.399=DC:1( AX[fps{|~||zyxvrokkfc`dfijkj-=>=<4%0\nry}W+ &!  6HNR^pxupnont{|ywtrnjhgda]]_^aeefhm-+:0&*Fknkt{~a,   -9CLT^gptwnjgehhfeigea[Z\]^`bh-)>ermlptwt[4 )  )3>LX_^]dihilb_abca^[^_ZWTQNMOTWX^.7sliklrpeYSD0" #-:FQVVUSSOSUORZWWXXZ[YUSRPMLMRY,3nkjjgXHHIJMMID;& )3:=@CGEBEGE@DLIEFGIMNJIFDEHQ,/lcXNE;68??;61) #'((*-..-/3443887899;GJEGQLMWaehhmmlqolqnsrtvwwwxz}{{{~||}}z}~}~~}|z{yywwussqnomkigec`^[[WUQOMIDA=73-!. 1!#$$%'(*/129>GRTVcfWSUSYUTZ__^aeaWUZZVQPOLGFA><>=>>H   GRS;"   59Xe="    "24--1EYdg<!   +0$(',=PQYjR;"  &()5@OLO]ZS:"   !)(.5;D?CT\TZ;"  &  $+%+.140+:Q\TV\:;"   ',# %+)' ,FRRQ`T;"   *(  4DHMXY:>"   " /+$4??KTK="      #  10 &45;OT<$      23#  &.0EVB@%      53$ #'6RL%C$  !     @, +LQ'F'*=@6%       $C) "GS'G+(,INOMGC@?68;:GPB32*!  '   (A'  KT(J-53HMVWC6=JORPKPdmlacT^cXE'  ''&9=+(#   +8,    $QY,J+, 9NQKLVI3()./07=<5"  !/7C\F3>?A??;* )E2#  @kY)L' 4/$(!   J$&2C@!%9?@97/#,F8+" Cg`+G&49$  (5*)6:/2@;65.)"   -J=0$F`a-D$+B+ # &D;'*/4)(?:;A=7/*.&' 2L>-%K^R(E!A:   ?E,&'0,7=;@EEA<7.# APA2*"#P^M'D 9H-  7J8+')0"-@==>8( "$ )PXI=4)%&" )T_M-D;J9  (A=;2+/1 $=OSKBBGE>>82)$" "&(# ,SYMD:0+)$!.U\K+D  /OO.   W#>@><0.4')DVTLAAGLKJF=61/,(&$"!! 5Z[QL?85.(&" 3VYJ&D(MVE"  !#(%7M??8440"/JTNDBEGGKE<<>>8-(#"3 !! $Hb_WN?;;4-)&#$"$8VYG$D >VW8 S'2.1OG>B;45(6HGEGE>97404521/)&'&#$&$!"!*Qec[M>??82,*)/,-%#=WZG#G+L\Q1M(660HO@C@940" $6@GMK@99820//10+))(''&##$" -Uif_J>DB:8410<54,)! =V]G%!GBT]K%")893ESF@C@68.# +5ALKHFA:632564/-+'$$%%'%$,Ykh`H=FD<8@6:2*" %@U^G%!"#%F  6KWW=Q&/;;6BOI@CC;;."!'.:9643200+)(('')),6amj^E>GFAAC==B5>5*$#*EV\E%##%)-G2CPTK2%17<<9BOOMECF@7&!")1=>CW^UKKMF>9541,*,#+2FipkS>AJFFHIAAC5>7*& $)ERTC' #&(,.1Fl :ILNG'*8<>>:?NSVLEKB5'!%'.8:@MV\WVRJB=::960-.03453-5LlrjI:CDCHNKCFE5=7)*#$'=NJB+"" !!  !##(+./4G_)GIMM<$.9>??<=HRVMFJD>0$%(-357=EORQKGGECBB<77:<>?=818OjuiG8CCEHLGDGF4<8,)$#'5HF<-%# !"!#%%&)-.27J`BHEJI. *2:@@??AHOYNCFI@9)$*058:;?ABBCGLLJLMHDFHGGD@:2;QjwcD6DFJHGGHGE6<6,+&%*4AB;.$$""#"$ %((+.1137;Ik8GBELB( #,5:AA>??JKWWDAFA;*&)28:<@CBAABHNLJIKLJLOPMFC<6A]nu^<5EIIKFOIEF8<6+,'),2<=B/%%$$%%&'*./03657<Gm3EDCIJ9 "%,6<@B??=IZ6ACCEHC-"(,6=AB?@EB3;8..0(+0463 +.-/223565577:?>=A`BD=*#(.5=BD@@CBIYZIAHA>BB73:AED>@INMLNRUUWZWTOPQSM?HWdnbB5>JQVVKM@EB5;8.-*+.33:/ ,016:8677668:=<;<:Hp!6?B@>CE5''.7>BEBACBFRZODHIB@?==ACHGCGSXURUY^`_^XSLMSUI@J\gp\<7AQSTLGIABC8=:3.-2/34:% %1337=B?:9887;=88;;<>D=-(.;@DFDDEBFMTTMDIGE?BCIJMLJKRTTX\]__]ZXQSTUVTNBUhqY64FSUOJCGB<@8@:20961780+3536:>@;9755;:7;<=>D o#4;@?=@@3+07?:25@5675#/77667;<:6458::78;@?>=B  r ,:>@A@A<46>EFHJHJHACORIGF@EJIHTUT[_`_ZY\befihe^\]][UOJCim9/DJJVUKC@D<=:?:3?E573,%689877996459;:;:9>A@?;>o   $7=?AA?A>?DHJLMLLMEAHRLHE@CIHILaY[\_c_]_fjllhea_^^\WZUTjpS14CCR]OGC@E?<=<89L?74,5<9:988798 =;99;=?A@=96= /:=>>@>AEJLNOPPNPJ@@LPFEC@FEJIb`\_dhidcdjlieb`_`^\\_]ecdL06@EZZHGGAD@??:9IQ760%5A>==;:;<=;:;?>:89=@@>:86>a  '29<@<::<=<:862<x  *2::?AEFafgmtwyyspngilqqnkjkVH\[K6-7CYUPZPGDEEA>HWJ:2&)PHABABEDEFCB?>?>;9:88:8510;y !$$*5:97@IIKNY[\]]XZT:?AKimkoswxz||yvy}|zwupR]^TD/,:JROV\KQLJF@IYP;2' ELEDEGJMMKGDB@>=><;9678620/8h !)/27BKKC6$7>;=?EJMOV^``_]]ZE6MNEHD?CA:;9asnpsz~|~zaRc`L:+-AOGM[THXTFCEUP@8." /LJIKOSQNHEA@><>?>;:85420-7 #,:GKR[bfd]M0-4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DFIMPRTUX\chgml6%62-' Gb_djijg\SZ\[[Y]bv{}}}ytnge]YWSPMI7[MOQRWYZ\_``_ZaP%@IOSUQ=;JgsolmcYNB;0&    ;* !   *Ximmgbglhnwvrqqplihjjheabedeghgda_]<+XY]__bedeikpm9BQW_^YWUPHE;& >apnljkmkmttpjllkfaacbb``_`_^acdeg=KY\\^acdfigmfU<-=Wfeffe`UG5  K\^hmmqwrlnrpnookighgda^^__]]^_^__^\Z\=Z[\_`dfefP:MeK(8OPPSSMF=0 AW]\^isw~ofgfhhgiifda``^\ZZ[[\^_^;E[^__`bN57UjiI(+013880)! 6IKU]aghjkhikgfeeffca]Z[VTQRRTWYYX[ZX=]\ZO74K[`fhI# -?ABCBDFFGHKM PRPRO<5I[UZYWVT!STUSQOLE@80($!#',17?FLPUVZ)[\ZWSQROMH=9;<:;?BCEKPTTUY]ccehhlljlroW7##%2~+4<ADGKMPQSUW[fiknooqnnopqqnuvsxy{|}}~~}|v{}}||~}}|zwyvwussqookkigeb_^]YWSPOMHE?=83-%=112.-,+**)(''&%&$#""! %-75-($*7941-%"%#9$,..)(.0/4BHLPQSUY]bgghnpw~~{tuzv~y}vvtpmjgjkp/&&!!+28865>9/09DFGMXb^^i4#385(&,062.1+ '19>@BHORI<67AEBKY^`\aQ=T]j4)-2/..+)()076:;0)(1IPKHGJMHDGJGLX_`hnf^`]A.8LJPeMg5:'+,0762.(+14;EIKIJIC=7118BH??IPTWYZPDDP[\]\[_V3*1;KFGWTLe6=$''%+4403242.1ASTRQNNK@/"%/6:55DNU[^WK@BKUXWY\P2&+27A==MYPUd6A!(*('*370*1>EA0(6DIRQLKE4#!).128EMPTVOB>DMSX]\K3$'+.0.+7NZRQV>b7C$ "*45,)5@A@3#%0=DCEG;) ).3;BBCEFD=AMTZ]Z>1"#''%+EOQN^Ub6 D#-332:AA=6/+''-27AF>1"!-27;99:;?CLTYYU>*4BGLYX:b7G ! #" '1;?>GRURJ<671((1:856/!$*+148>BGNUVRNC/$4>B8& '.-ETEc?$'(-,$#+4:=EU[]`bba[WM<50#" !#%)-6:;:>BKE9( $(6PK8i>@!"#('**'/-179<;ANV\_ccYUYSLG;-( $'" #!"-448A>FK1  ,KO474lI2LM>.F &(('(&)*9@6943:N,   "GS.66>p`_1ILMKEC?@7:>?KSH=?6(")*.;2-4I'   KS.537Btga8EHPR?2;HLNLHNajg\]OYa\P1-FQCG`hiitykjgXLEFIA1$#)(##!"'-1.,)).84-16:+      $PV2546AGt`?,8JKFHSF0'(+--299:CILFT\V^[E24RNF[hmrwpgfbSD@CED:' "(,+*()+-125/    .YX5458@EDqbe=@?DHCD>5!!$$#%%&/=<@\^OA,Oecgjnrmdb]VLEGIHJH;*$$!!%*)+.*+8.   3aX02365661od+-75@LI@41"$7DDKP@9[vuvwtqrk`YOHJHF:*"#  ""!$*+-."*>,  6iV-,02-,./1v^P(./5;3    /7AUD(9jxz{xywlc\SPMHDCFKG;,'##''#'*)((',/)*@-"   :iU'#*,+,-033~b0+"&  #&/;7 ,Iszyutngb\Z\UH@DHG:.')+&&,.00,,0.",?3+"   ;b_("('+/01335xb14  < )6+(03*-azutsokf`df]PJMNEBHF:/))$%(*/2363,*@8/# )##+*9pyx|~}{xtngcYLDC>91./-*+-240) 9G8+& !ERC"!"#*.0215679wG7@(  < 2A3($&,![|yy|~~xrqnh]KEDC@BGIE=8520230,(%BJ=1*! $IRD% &#&/1125799:wD (A8   > )<60('-'Cm|~}{x|}zy{wm_XPLDFPZ^OB?<7761-'(EK@6-#!#$IRD' ,!#13466567:9u@:D4   "9;6.*,. )[w|{~#{vsmc]UPV_bTHD>98941(*GLA:2*'&  'IQC%*&57:<v?2KK+  >5>;7.-1&Nl||}~zurpk_XSPMHD?<==84) 0MMD?500*# ,JOA"(#)677689:=@u8 .JTA  N /E>;622."?aq~}~~yxz|wgWMKLHCEGEC>:.'=SPI@534.'#! 1KO@!(#,889:;4+DURL@5871,'$$)'(!4KP=!&"2:;=>=<=D|./L]N-  *,)>J@?=73.'Rdkw|zv5splijeZUVROPMIIKHB;+FVSN>5981/.*+3..($5KQ>#$&8;=>=?@?@ADH~,K>S]G !,-+9LE?@<43/Fbfou~{xusmmpkbZWVVPKJLNKG>+JXUN<5<:3 12813.& 7JQ?"",<<=?>=?ABBGHKP}.!4DXU6(%./-8GG@??87,4]flrz||yusmfdb_[WSQ1POMC2P[WM:5=;78956:161(!$!"2>@AA@A@BCDIMQW]}3h:NTC,'+/1/6CKIB??<2)Vdhs{{~zoffec^WYYWWYWMA@V\VF56>;:=>89;272(# %=HL=#'08=9IOICD>:-0[dltuw{}zwunggjnqqmbMBLW^T;/9:9=A>=><274*'#"&2BC:'3GFGKIJIHMPORX]`gq7'#'"7?@@?(!'-1324?>!<263+)&$)2=@:(4GHIKKLMMOST[acejry2u(.30& $2<:=A8"#*-22124?+">@@A<;<353+*+1:<;)DPRSQSTW[aeejosrsyzHD:@C>5/%;:;;12H_l{~x|zwzy~~{z|hXWUD,/:>&@A<<=325.+.--2:84! NUTVVWY]cfgkonrvxzw[ DCA5-(!#B<;f=>1"&+0232334FLHJFDDA74CQnvzu|{{~|~h]JMYR?,0:?@@>@:>;233.-0+,0783 #RYWXZ^aegiilmltz|{v\[MD950+% "!!5?:;;<=9)!&+0443355@MIFCD?@>=AOntz|yvux{kcCNZO8*2:>AC>A8<9154-),06:4 'V\]^cddehgikknvxxwvuXJA::85.+'%$ 889::;=6$ %*0454355:IMFAE@=@?>BC@>?:885730.-1058:'Kddekqwsmlkjjprllrrstv^]G?I]`UK=30/)'*&"258989<5&!&024755678@JMIDFDA>?N|{ROSWE,,8@B@>==:785740049;1VhiginsuoljghnmknsvxwxrTHFNab\SD:91*.066887:8,$(135776877;GIICDBDABLjDOWW;(0;@BBA:<;8948513958;6$._mklkkoonkhimonkmrvxxwphPMR]a^_\PHIJOPJ;1-28789894,-3678989;98DKHEC@CECGkyhIR[R0'4;?ED@<;;9979639=8:6-Gkp nmnmkhjnpnpnntwtmSGKXba^_^WSTUY\_S<;188795479::;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MNG8%$)(WrC;.:61)/>5Yu@O"2BMUYF/9NSGMcjgeecb`][YTLD<5*! 03$(t Sc&8HRVWI/0:G\behfbba`\YTNGA:0& Ql_+!4DNQVXG).Nbadhf``^]ZSIB<92'  Uf P-@HNSSP95DZde=_YRNJA4-)&!   ?VSZ\]^\SKRUVX[^bgDz%#:EKOQM60?Y`^ZZSJA82)    3KOORYZWXUNNMPQNHFMZLTtg'J!2AEKJB21=LRQKHB:2(!  9UQPTY\[\VQQPQRSRPKDA?=IS\o{h)+7:A92*(07:;986.#   "=Z^ZSRUY\\][[YVUVVUVUSQPMJIIB;AU{jq20./0-$ &* '('    /U^[YXY\ZWYY[YZ^ZUXZXWXWVUQQPOOJE@NhkEZ"&(&   %R^]ZWWYY\][]][YYZ[[VSSRSUVUTRPKHMkg$/>@=0%%##41#    %JTVVSOTWTY__\[ XVUWWUSQQTSUSQQNMnCX=EJONKHGC<91! 7T`\YWWVWXVX\]ZWWYXTOQTRQQPPQQOPQRTTpj=*5JU.VUQI<- ANQX[Z[^[XX[\YZZXVUVVSQOOPPOOPONLMnJJYC$0DEDGGC=6* :KNNPV]^aXRSTTUUWWUTPPQQOMNMONOp?R;J\[?#&*+-21+$ 0@AHNQUTUWUTVUSSTUUTQOMNKHFGGHJKLLMLKrCZBEOSZ\?   (58;BKPOMLMNPUVTSTSRRNLLJIFDEFFGJIIKNs*zYA:LPOVZ[F"  !*07=;:=;::>BvQO/ND8799:973- &+-./22035303963568::986567=wPKD=5-+,10-)% !""!$' +**+,,./04459v)>4*$  "%',6t 0#   %,x)  $,z5iGIRMRTQPOONNOONKIF@:5,&!#',18>CGKLOPQPOLKKJFA:798;>>?CHKKLORVUWYY]^^beeYZ}z8BIMPatt*479A?DIEOSIJU^hflkmkkjpoqroruqwyw}}{~|~}~}|{{~~~~}}}{yywwurspoomkigeca_\ZWUSNMGEA=93-%*37<CAGJGIQLOWaehhmnlqolqnsrtvwxxy{}|}}~}}}}z}~}~~}|z{yywwussqnomkigec`^[[WUQOMIDA=73-$*+4<ADGKMPQSUW[fiknooqnnopqqnuvsxy{|}{~}|v{}{zz|}{{yxuwtusqqommiigec`]\[WUQOMKFC=;61+# &   &   ; ԩ`<-   %1Bg,Q-    9[zp f-   ;tuRjvg%   7x`I^aiyڇ8  #  "\H?LZX^kio   *.6@FNGNaibe &  !,+28;<81B[h_br ! $,('-40-% 1M\]\j&   ((%##%&!#8JQV`> " ,+# "(9FHT_}   ,/#*9' &+*),*,5DCHiqdG!     $A:  :if2%.DBIVUM@6&)>LN[cB"(()%    )J9" Atf2 *'H97>E<( &5>LfN!+,.*,)    .Q<(  Iwg/ 4 >7)-& ) #),:PL%&,+&%  2TB0%Oul2 BCD*  + .=0/AE8 *($"  4XH6) Sqn2 XiN3  ,OB,17?1&)(-)#   1+,'#! 2bp[6 IO~EXC! 2QHF;48:&&=A;/.4422*%"" " 2djZQE:3/+($! 6enZ3 R3[[6 &&+NMJG87>0/CD;/.6;970(&&'&"?mm`YJB>70,)&" "  =9$6A;1/5 :3**+-,& 'Vvpg]KFG>6/-**(+$" CgjV+ G E`cBT1>:>cUJNF>>/%23264+')*),,+*(!/axtm[IKKB<520745,*#!GglT* #-Wf\72DB=Z^LNLC?9%"-4<8+)*,1+)*)"3f{wqXIQNEC>::F>?41' #'IfoU+ 2qJ^fU+#6HHATcTLPLAE3!&/;8540/5-..,'#  4k{rUISQHHFBCL@E;1)#&,LgpU, s~qRITSNNOGIN?I>2,$)1RfoR,0bOZ^X<P#1?FLNHSb]ZRORL?)#(--2FLE:;<;71**('"!#4R|dJMWSSWWMNO?IA3.%*1RbdQ.#wl EVX[U/"'6HMOPJPaeeZQXL?,"'./3:4/.,(  ##%&&7Y~XFRRPX]XPTR?HB21)*/H\WN3!$1ol.TUX\G !'/:IPQRMMZef[RWPJ7% !(-0258=AC@>?=976/))+.12/++:Z|VFQRVX[RQUR>HC31+*/?VUH5 #%)m!LTRWV7"$*5AKQSQORZbk^QTWLB, "(-134688::?DCAAB<79<<:61.+:]~xTBQW\XUVYURAG?44.+2>MOG6  #&(+B^ATOSZN/$(,8EKRTQPQ^\ilQMTME/#"'/238<:778=DB>>@@>ADD?642/AjtK?T\ZZVcZSUBG@35/05=GIO8 "$&)--05):QRPWVD&$+/8FNRTSRM]e]sYNQOF6* &.59A;669<=CB<4644Mto=AWb]Y]hWSUAFE31145;FGG3 $')+.101]d :NQPQVP6 !+39FOTTSRMVp_i`TQPK8356<949AC?87;9>A>99<>46Bu|YCO[b`eafQTQ>DC87B528B@; "%)*),--37"q%FOPPQRN9(+4:DPVWUTUSeveWRSNPMG9(+39:74248;=<9;>??@>==A>4@M|vXDQY_eo]eKTP?HC67:/5:>A= !##&)((*+.4454Kp 2INNMORI3,2:DPVXUSUT\opXMUNJPO=00586/2;?@=?BEFIIHD==>A;3Gbz}UEO]gnm]^NVTAHE86237=>F: $+*(('((+-120213dp?E-  &/41,*))*.0,-002* .CMMJJQI82;KSX[YXXSY`he\RXURLPG?<@>:ACCA@@bqEC[lkb[QWRHOCOH=:EC/ 60''*.35650-+(')++('&&('#"aw+79+8IFIMUZ_bmz~}yvxsVB\]TVRMPOEF;Ud^adkruuz}yvupklhURrt^H58QeV]qhVnhTPTjaMC8( #1,-27<>=:5/,)'&&(++)(&%%" r<h $38=ISXQJ<0CHLSSW\agw~}wudJSkXPPMLNFD4GkmkmuzwzlGYqoR82Fc\ZojeZf_VX\dNC<2 09>BFGGD@;3.)() *--+'%""! Q//%*4DNX]aa__PKG8@GRWV]^`m}~uxkRIeeOOMJI?:2exww|eRgniC5?[iUltgmaXYac\PA:4 4PVWVSRMHF>3-)+,,- ,*'(&$$&H0 (**,+**+3BS_aefefigcG7CKWZ\gaiq|ow~]JQgYQNMGHLD$O{|[fksR2  +05GQ`a]ktgurqhWOTYVUPNHPP?8jYGcr<'7CINWcokdb`ckdKBB32iwrkdcefdbaZNGFHHIIF@=:9;;976:(7@CFNSY]aejoqtuy}~\:?EWfYjxmjv`UMSXVVUOJPOF8b{GXqc-.>GLZacmdgjeklaPJ; Tsusrqqpnige`ZXVQNNLGBACDBCA?=;k "3ACEJTbghjntwxy|J6*''2v}|{zzvttpmfaab`YVVRLFB=95 #+:O\hszO29A[f``uptm`]RFM]d`e`^\^[E{q@Ntb/)@NNQ[agr|xyocWE1+-$W~y{zurlihec^YWQLFA>;7 %7K[jvz\833Fh_TiwwreaXMIWcfdib`YZFjwYCiqF'3HNNY^fnv~}wqf[L9.1+6~|uomkfb^YUSPIC?>7  *9GSeqy~`;.8_hTWompib`TKO]ilikja_LMuDSq^1(=LPT^fkry~{ti_Q@33/$_}ztqlfb^ZVSOID@=7 $4@N^gt|DtY4/KbWRhmfdeg`TJVdphjpjhV0QiAemE&2FKU^cjmx}|wndXG:50%/xqjeeb\XQLHFB<8  #7L[gs{uO11KXPUn|ma]gcPJYmpainniFAfL]sY1)>HQ^dgju||xri`SB8/$Xytqkfb]YQMIF@;=  6IXit|rC*5HWQRot\_m\GQblhoy|~wdYdu}ygKNqlA(4DO]feiq{}yuogZD6,!)~zxtogc_XRLIC?:D^ !7DM[jt|o2-;HRU]r}xppjWYenw{yyw}}uc=2[cK//Qct{}^0CZceUTcu}yvvoliilnqlhmrqpompqorulkuwV2?wpnnha]WLHA;52 .=ITalt}5N(?I836/ !8FLS\hu|9%"/Vlyvotummljllkllmlmnmjklommppkl_;)ytpje_XRNF<73O5S +9EQ]fpu{|~l"!OquuprtommlmnlkmDklnlknmoponrjWD-c|xsohb\SLFB<62l/ ->HOZdjov{}s:MqtppsromlmnomAlmqqoqm`mm\F4%?|xsplg`XLHC=92.) /;>BMXbhoux}~[OpuonmJlmnmmomnoppqrrqndhpl[?"&{wtpjb]YTKDA:5/++0 */6AJQZchlqzkKjsqppmlImnnmmlkotrnprnlgjqwk> `yuoga[VROHE@:3-H*h #$+=OW[bilrx~wRMouzqmlInmnnlliorklnmjgchotmE <}xqjc\ZUNJEA=:2.{* "#):N]agkmt{|d4Wvpm#nmomknmkkmmimnkhfglgbfH !$yuoga[WQKEA><:62*) #(1DWainpu~uB:s}{unm(nompoonilpkpqnqsqojgjobUT: 4"{uqke_ZUOHDA?;;8L%j").=R`jtw{]>rypmKopolrrppkjqqwuxvwyqjmkZLE+ #}wpjgd_YTNIGB=:<=$")1@Ucmtw|o@asmnrpnlsuqlty{~}zol]K>:2 d!}vrlfb`XRNIDA;;AC#?$+7GVbkorx{W@|qmMnoqooruwssuqw|~tlR9-,3- T~ytrlf_\XRNJFDBCDe8'/7FMU`fox|nHcysqnmmnppnotxxwvwyz~9xfF((30 D{wuofc_ZWTRRLIGFD*"(-5BHR[enw}nLr~{vommnonnvcF##3=1$`!}yvspkeaVOONJF@BH%n!&').4:CMSZfqy{gEysnmmnJr}WLg/=9+!oyutple^WOLE?=;?#*!$'(*,/6@IOVakt|~|u\^zpmnoJnvu4q| (:C8'!}{vokid`ZRJ>8< )>DC6',~|wqkfa]YSF;9== DKUalrvtuupaVv|~uonlKory|Z: G[RI>/#F{wtohea\QJB;88O!!#'-7@FMT]ejmoppqZNhw|Ptomiikox~l^^J/-4F^nn^G3'"zzwrpjc\WUQKDA?9mO!"%).6?GNUY^fkmmspNOp|y{{vnmgimr~|mimonlilqpkX=+B|xrkhibWROMLG?:d?) "$'*,1:CJPRV`ijilVCcutw|xtspgjp}~{vuwxyyvuvhI2$(&t~{wrojdd]XTOJD?9<3!"$&(*-28?GLQZ]abYDTdkjxyv{ulmy1|rX<- C|xsokifb]XTTPJC<9.V#%&(+-/4=DHMSTUVOBRVYiy~{}wxw}dB0--#"r}xurmigca[WPMJHD;fD9&'(*,06=AEGHJKLNA=IWjpglwy}~{ywrmnneO3&./&<|wsqkfgd^XSRMFB>Je*)+*-1489;>AFHGNS17Odmlju~|s}piffe^UH2!#*46$s}xtnmjed_YTPPKA<:*--.157Z9=FLKOU2+Han{hgsf]VQI;,!(1:/?{yvsokhdaZVTMHA=;3j-011479;;=GLNOP0$?YkxtWk{qfYL>0&,$//!vzxtrmidb^WSOHB<8s"Y/24459<>AEGJLO62Lcpw}oPVbo;~sg_TF6' @{wsplif^\XTPJDA:_P2568:;<@SDHMC"+EZfmtxh@Grxi^VQF7+ [}xpojeb^ZWQMIE@;V/J46889;==>=?BF4";T^emonQPdvqj[H?:6.$* Rsnu{yzxjagige`cjwxzxprpmif^WTOD?;96L[E5799:<>??<9@;-LX^efaLO\yvi\OF8-&  Fktpw~{oonrtlkj\SY_ORggdec`SLA643CYN788:<>?>;:=;#"?RV^\QCERfomig^RG8-#  S{wvtu{}wwuvuv{zvrh[UQKPSTZTQK<3GCV8;=<>?=?A@@7/BIQH>54=GMOLML@0%   -Wzx}~|~ywsojgdWJDKVO\$a:<;=>?@CBDC,*5;<7-(/466345(  By} ~}xvtsoj_SS|!u:;=?@@BBDFD4 $$&263)#(! -  4y|yxvx{z||}}zxutqj=<=@CEFGG< 0AW\VC3512JG2  1i}zt{|{z~}{wsuv wvxzzyvu K>??@BDCEFKM,K_isrligaUSF-  Jt~xqsussrrqpopquw2n>?@ABCEDJRMA5Ijzyz|ysfVA' Znp|}zwrooponnoppqqonH?@CDDB74Ux[1B_a_cc]UJ:# ( Oipnq}y{z||{||zwsrrpmkjkllmllnox/k?@A@1';e~V.399=DC:1( AX[fps{|~||zyxvrokkfc`dfijX<4%0\nry}W+ &!  6HNR^pxupnont{|ywtrnjhgda]]_^aee{+6*Fknkt{~a,   -9CLT^gptwnjgehhfeigea[Z\]^lӉormlptwt[4 )  )3>LX_^]dihilb_abca^[^_ZWTQNMOTb7wklrpeYSD0" #-:FQVVUSSOSUORZWWXXZ[YUSRPML]3鸈jgXHHIJMMID;& )3:=@CGEBEGE@DLIEFGIMNJIFDk/ϙdE;68??;61) #'((*-..-/3443887899;." '3DhlR.  :`xdh/    DrEYdh&  +0?yZ=PQYjڈ:  -]A5@OLO]Zp   !)(.5;D?CT\Tg  &  $+%+.140+:Q\TVt   ',# %+)' ,FRRQ`(   *(  4DHMXzA   " /+$4??KU~      #  10 &45;OE      23#  &.0Ec      53$ #'6R[p  !     @, +LQ*~ U       $C) "GS'^(mVQMVz^:GPB32*!  '   (A'  KT(I5wMVWC6=JORPKPdmlacT^cXE'  ''&9=+(#   +8,    $QY,?,VQKLVI3()./07=<5"  !/7C\F3>?A??;* )E2#  @kY)< 4/$(!   J$&2C@!%9?@97/#,F8+" Cg`+I:9$  (5*)6:/2@;65.)"   -J=0$F`a-^eB+ # &D;'*/4)(?:;A=7/*.&' 2L>-%K^R(|A:   ?E,&'0,7=;@EEA<7.# APA2*"#P^M'VH-  7J8+')0"-@==>8( "$ )PXI=4)%&" )T_M-R;J9  (A=;2+/1 $=OSKBBGE>>82)$" "&(# ,SYMD:0+)$!.U\K+ /OO.   W#>@><0.4')DVTLAAGLKJF=61/,(&$"!! 5Z[QL?85.(&" 3VYJ&(<(MVE"  !#(%7M??8440"/JTNDBEGGKE<<>>8-(#"3 !! $Hb_WN?;;4-)&#$"$8VYG$P >VW8 S'2.1OG>B;45(6HGEGE>97404521/)&'&#$&$!"!*Qec[M>??82,*)/,-%#=WZG#$+L\Q1M(660HO@C@940" $6@GMK@99820//10+))(''&##$" -Uif_J>DB:8410<54,)! =V]G%;rBT]K%")893ESF@C@68.# +5ALKHFA:632564/-+'$$%%'%$,Ykh`H=FD<8@6:2*" %@U^G%!"# 6KWW=Q&/;;6BOI@CC;;."!'.:9643200+)(('')),6amj^E>GFAAC==B5>5*$#*EV\E%##%87cCPTK2%17<<9BOOMECF@7&!")1=>CW^UKKMF>9541,*,#+2FipkS>AJFFHIAAC5>7*& $)ERTC' #&(,}l :ILNG'*8<>>:?NSVLEKB5'!%'.8:@MV\WVRJB=::960-.03453-5LlrjI:CDCHNKCFE5=7)*#$'=NJB+"" !!  !##(+.:p_)GIMM<$.9>??<=HRVMFJD>0$%(-357=EORQKGGECBB<77:<>?=818OjuiG8CCEHLGDGF4<8,)$#'5HF<-%# !"!#%%&)-.2`BHEJI. *2:@@??AHOYNCFI@9)$*058:;?ABBCGLLJLMHDFHGGD@:2;QjwcD6DFJHGGHGE6<6,+&%*4AB;.$$""#"$ %((+.113Hk8GBELB( #,5:AA>??JKWWDAFA;*&)28:<@CBAABHNLJIKLJLOPMFC<6A]nu^<5EIIKFOIEF8<6+,'),2<=B/%%$$%%&'*./036576m3EDCIJ9 "%,6<@B??EB3;8..0(+0463 +.-/223565577:?>T1>A`BD=*#(.5=BD@@CBIYZIAHA>BB73:AED>@INMLNRUUWZWTOPQSM?HWdnbB5>JQVVKM@EB5;8.-*+.33:/ ,016:8677668:=<;=ep!6?B@>CE5''.7>BEBACBFRZODHIB@?==ACHGCGSXURUY^`_^XSLMSUI@J\gp\<7AQSTLGIABC8=:3.-2/34:% %1337=B?:9887;=88;;<+ o-:@A>>D=-(.;@DFDDEBFMTTMDIGE?BCIJMLJKRTTX\]__]ZXQSTUVTNBUhqY64FSUOJCGB<@8@:20961780+3536:>@;9755;:7;<=>\  o#4;@?=@@3+07?:25@5675#/77667;<:6458::78;@?@  r ,:>@A@A<46>EFHJHJHACORIGF@EJIHTUT[_`_ZY\befihe^\]][UOJCim9/DJJVUKC@D<=:?:3?E573,%689877996459;:;:9>A@?mP   $7=?AA?A>?DHJLMLLMEAHRLHE@CIHILaY[\_c_]_fjllhea_^^\WZUTjpS14CCR]OGC@E?<=<89L?74,5<9:988798 =;99;=?A@=t* /:=>>@>AEJLNOPPNPJ@@LPFEC@FEJIb`\_dhidcdjlieb`_`^\\_]ecdL06@EZZHGGAD@??:9IQ760%5A>==;:;<=;:;?>:89=@@>:V a  '29<@<::<=<:8<x  *2::?AEFafgmtwyyspngilqqnkjkVH\[K6-7CYUPZPGDEEA>HWJ:2&)PHABABEDEFCB?>?>;9:88:851 !$$*5:97@IIKNY[\]]XZT:?AKimkoswxz||yvy}|zwupR]^TD/,:JROV\KQLJF@IYP;2' ELEDEGJMMKGDB@>=><;9678620ha !)/27BKKC6$7>;=?EJMOV^``_]]ZE6MNEHD?CA:;9asnpsz~|~zaRc`L:+-AOGM[THXTFCEUP@8." /LJIKOSQNHEA@><>?>;:85420z >#,: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Y]bv{}}}ytnge]YWSPc[^QRWYZ\_``_ZaP%@IOSUQ=;JgsolmcYNB;0&    ;* !   *Ximmgbglhnwvrqqplihjjheabedeghgdc+g]__bedeikpm9BQW_^YWUPHE;& >apnljkmkmttpjllkfaacbb``_`_^acdrKކ\^acdfigmfU<-=Wfeffe`UG5  K\^hmmqwrlnrpnookighgda^^__]]^_^__^\f_`dfefP:MeK(8OPPSSMF=0 AW]\^isw~ofgfhhgiifda``^\ZZ[[\^gEԄ__`bN57UjiI(+013880)! 6IKU]aghjkhikgfeeffca]Z[VTQRRTWYYX[rZO74K[`fhI# -` ٯfA1% !,8Jm´ڴoL@3%!+28865CEEPd#ɡhG/062.1+ '19>@BHORI<67AEBNr{`)N2+)()076:;0)(1IPKHGJMHDGJGLX_`hny\8LJPe:ܑM'+,0762.(+14;EIKIJIC=7118BH??IPTWYZPDDP[\]\[_[eB1;KFGWT=|3$''%+4403242.1ASTRQNNK@/"%/6:55DNU[^WK@BKUXWY\P2&+27A==MYPAo&!(*('*370*1>EA0(6DIRQLKE4#!).128EMPTVOB>DMSX]\K3$'+.0.+7NZRQCy$$ "*45,)5@A@3#%0=DCEG;) ).3;BBCEFD=AMTZ]Z>1"#''%+EOQN^F1#-332:AA=6/+''-27AF>1"!-27;99:;?CLTYYU>*4BGLYyGE! #" '1;?>GRURJ<671((1:856/!$*+148>BGNUVRNC/$4>B8& '.-Ea9(-,$#+4:=EU[]`bba[WM<50#" !#%)-6:;:>BKE9( $(6PZB~!!"#('**'/-179<;ANV\_ccYUYSLG;-( $'" #!"-448A>FK1  ,KO6FZ &(('(&)*9@6943:N,   "GS.6s_mTOKTz`?KSH=?6(")*.;2-4I'   KS.53aauHPR?2;HLNLHNajg\]OYa\P1-FQCG`hiitykjgXLEFIA1$#)(##!"'-1.,)).84-16:+      $PV2546^?RKFHSF0'(+--299:CILFT\V^[E24RNF[hmrwpgfbSD@CED:' "(,+*()+-125/    .YX5458@\e@?DHCD>5!!$$#%%&/=<@\^OA,Oecgjnrmdb]VLEGIHJH;*$$!!%*)+.*+8.   3aX023656G+75@LI@41"$7DDKP@9[vuvwtqrk`YOHJHF:*"#  ""!$*+-."*>,  6iV-,02-,.HPA./5;3    /7AUD(9jxz{xywlc\SPMHDCFKG;,'##''#'*)((',/)*@-"   :iU'#*,+,-0S0+"&  #&/;7 ,Iszyutngb\Z\UH@DHG:.')+&&,.00,,0.",?3+"   ;b_("('+/013^74  < )6+(03*-azutsokf`df]PJMNEBHF:/))$%(*/2363,*@8/# )##+*9pyx|~}{xtngcYLDC>91./-*+-240) 9G8+& !ERC"!"#*.02156:T@(  < 2A3($&,![|yy|~~xrqnh]KEDC@BGIE=8520230,(%BJ=1*! $IRD% &#&/112579L A8   > )<60('-'Cm|~}{x|}zy{wm_XPLDFPZ^OB?<7761-'(EK@6-#!#$IRD' ,!#13466567i:D4   "9;6.*,. )[w|{~#{vsmc]UPV_bTHD>98941(*GLA:2*'&  'IQC%*&57:#2KK+  >5>;7.-1&Nl||}~zurpk_XSPMHD?<==84) 0MMD?500*# ,JOA"(#)677689:G J.JTA  N /E>;622."?aq~}~~yxz|wgWMKLHCEGEC>:.'=SPI@534.'#! 1KO@!(#,889:;4+DURL@5871,'$$)'(!4KP=!&"2:;=>=<=6/L]N-  *,)>J@?=73.'Rdkw|zv5splijeZUVROPMIIKHB;+FVSN>5981/.*+3..($5KQ>#$&8;=>=?@?@A[K~>S]G !,-+9LE?@<43/Fbfou~{xusmmpkbZWVVPKJLNKG>+JXUN<5<:3 12813.& 7JQ?"",<<=?>=?ABBGHK-4DXU6(%./-8GG@??87,4]flrz||yusmfdb_[WSQ1POMC2P[WM:5=;78956:161(!$!"2>@AA@A@BCDIMQchq:NTC,'+/1/6CKIB??<2)Vdhs{{~zoffec^WYYWWYWMA@V\VF56>;:=>89;272(# %=HL=#'08=9IOICD>:-0[dltuw{}zwunggjnqqmbMBLW^T;/9:9=A>=><274*'#"&2BC:'3GFGKIJIHMPORX]`g:'#'"7?@@?(!'-1324?>!<263+)&$)2=@:(4GHIKKLMMOST[acej~u.30& $2<:=A8"#*-22124?+">@@A<;<353+*+1:<;)DPRSQSTW[aeejosrsDBC>5/%;:;;12H_l{~x|zwzy~~{z|hXWUD,/:>&@A<<=325.+.--2:84! NUTVVWY]cfgkonrvx| CA5-(!#B<;f=>1"&+0232334FLHJFDDA74CQnvzu|{{~|~h]JMYR?,0:?@@>@:>;233.-0+,0783 #RYWXZ^aegiilmltz|{\Z950+% "!!5?:;;<=9)!&+0443355@MIFCD?@>=AOntz|yvux{kcCNZO8*2:>AC>A8<9154-),06:4 'V\]^cddehgikknvxxwB::85.+'%$ 889::;=6$ %*0454355:IMFAE@=@?>BC@>?:885730.-1058:'Kddekqwsmlkjjprllrrs^\I]`UK=30/)'*&"258989<5&!&024755678@JMIDFDA>?N|{ROSWE,,8@B@>==:785740049;1VhiginsuoljghnmknsvxGNab\SD:91*.066887:8,$(135776877;GIICDBDABLjDOWW;(0;@BBA:<;8948513958;6$._mklkkoonkhimonkmrvxyhR]a^_\PHIJOPJ;1-28789894,-3678989;98DKHEC@CECGkyhIR[R0'4;?ED@<;;9979639=8:6-Gkp nmnmkhjnpnpnntwXba^_^WSTUY\_S<;188795479::;=;7>IHEC?AECFU2rXWYI**6:AGB?=;=;99857A<:7-#aurqoqnmorpnnorvyxudKQZaeb[Z_]YY^\LA;7:69889<;<==>=?=78EKECA@CBFLscYU?',5;FH@);=;:;77@E:92%TyxvwtsuutqqrtupmnrwyuqPCER_dc`_dc``^YRFJ81355799=>?>??@?@@84@IECB?A@DIcTYSK6'.6?GDCC?=><<:9?FB:5&J~yyzzxzyxxwtvwrooquspmoUNLLQY`eeaeigeb`\MK@2.556<;=>ABKuNTN>-'/8DEEHE@?&=;AID<5(5{}}|}~~}}xuwurpomnpnifUVVXW[fkhfijkooj^OO;43:??>@EF[DEB68GFDEB=A??C_f[PE7))20'+6@?DJHCHGA?BKH@:1$QzywtuwuqonjigegkjijimtzkdE<7;?=?ABDHIJKKIHC6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=EJONKHGC<91! 7T`\YWWVWXVX\]ZWWYXTOQTRQQPPQQOPQRbj=*5JU.VUQI<- ANQX[Z[^[XX[\YZZXVUVVSQOOPPOOPONzҭJJYC$0DEDGGC=6* :KNNPV]^aXRSTTUUWWUTPPQQOMNMONY辫?R;J\[?#&*+-21+$ 0@AHNQUTUWUTVUSSTUUTQOMNKHFGGHJKLLMvCڳZBEOSZ\?   (58;BKPOMLMNPUVTSTSRRNLLJIFDEFFGJIb*eA:LPOVZ[F"  !*07=;:=;:L3sOND8799:973- &+-./22035303963568::9865_ȍU5-+,10-)% !""!$' +**+,,./0M)|E#  &Fz Ô[6   <_دfA1% *6Hl%6FT_gmqqmg_TF6% ,X ǢX,GEwسwEW؝W+ N= ={&z0~4#c pܿ Cý>3<ff  1BGA%!" 굟ү17:GlFQ;2 2 Zeڛ1@@ŗnn ߕ 11//$$zz ͍ MMWW؉EEwwه,,YYDž%م%77GGTT^^hhnnqqqqnnhh^^TTGG77%م%DžYY,,هwwEE؉WWMM ͍ zz$$//11 ߕ nnŗ@@›11ee   ɣ 2ץ2;;FFGG:ح:1ʯ1""  ff33CÿC pp ##4400&zz& NN W؝WEwسwE ,X ǢX,%6FT_gmqqmg_TF6%ɹ ӧ]8' '8]L''LQrb''bPci8م4?lcp#3<{iAnnνMM 3 J`pt-5B'z (u6LFn%=r{ ::  oo``  mm22bbaa''LL&&^^88&&&&88^^&&LL''aabb22mm  ``oo  ::  {{==nnLL66((''55MMnnAA{{<<##ppccllم44ccb''bL''L ӧ]8' '8]ɹlugaru-0~20110520.1+hge4354.orig/Source/win-res/icon1.ico0000644000000000000000000000566611571222446020750 0ustar rootroot & ( @xpppfa0f8wwthwwDhwwxDwxpFwwwtHwwghx8wwxgwwxHxSwxDhxwf88wh8wxfHDDfDHD33DDGt3f3DDG8Fff3DD84FfD30DpfDDH1qfDD0pFDDDD@xDDDD@@D@@DH8pHpw??( @ʦ """)))UUUMMMBBB999|PP3f3333f333ff3fffff3f3f̙f3333f3333333333f3333333f3f33ff3f3f3f3333f3333333f3̙33333f333ff3ffffff3f33f3ff3f3f3ffff3fffffffff3fffffff3f̙ffff3ff333f3ff33fff33f3ff̙3f3f3333f333ff3fffff̙̙3̙f̙̙̙3f̙3f3f3333f333ff3fffff3f3f̙3ffffffffff!___wwwCC m C mmmmf nnnnmmmJϋf CmnmmmJnnm 푮JJnssmfϮmnssn fmnnssfnmmnsffJJmn_m 컵emJJ emJJm f_mCnCfeDmCmCJ굵CfJJmmlff_effCJJJlfff___<DDDꮮfffff<<<CDfJffffff< ffffJCBfff  CffffJCBCfC ffffeCJBBBf ffffCBCBB CCffBB<<C ѤZ9_>b?O5=3579D-0:27B7>J08C%,    @N]VkUj~WlYoWmTi}Sg{RexN_pNZiQWcXQT[Q̭AйϬAU:ٟU7\<`>\>F505y-5&@.RAiXpyzo\bmWmQdxK[mK\mObuVp\{cjTl$,.3=(+4:0-γ̰ɭħy~lr`dOS;cNкkf\p!x,!6*F7]Kucxifi[tTi~M^pK[mL]oRj}VpZwbhSl:CM )+3 & ϴͱ˯ȫŧ¡ypucgS\FT=\ϻx4-n }1%K:dPygzvllYnVnM^qK[mK\nNasRhyQizUn_|cTkCO_'+4"$+$|д̰˰ʭƨâzoubkVcO[EiVλBbp 4'ZEwgx|SZcSi}M^pJZlK\mL]oOaqNbrOaqRhzXpYnTdv?IW*-6β˯ʮʭȪŦswelY_LWBS<ˮBëOKfx'<']HuesfceIWePcwK[mJZlK[mM^mL^nL]lN_nM_pN_oL[jIWg=ER% βʭɬɬɬȪĦy|km[^MPAI7sgζ|zj"l~0L4aNsdrZ[bM]oL\oK[mJ[mJ[lK]mL]mM]lL^oL^oJ[kI[kBM[lZSʯ˯ɬɭʮɬǪätwdiVYHG9F=ưt1/;as!A,]Ktev}dYX:ALL]pM^qK[nJZlJ[lJ\lJ\lJ\lK]nJ]nJ\k4QJ;X h` z.S>rd{|EBG>DQIUfPbvN_sIZkJ[lK\mK\mL]nL]nM]pN]nN\m-1;>30Ѹ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tC2" UQZ0"3C2UWuWuC33 "Un"3C"UuWR32"U##3!UWWUQD33 "޼P@#3eU!D33 #μ0#3wU92"  -""WQQ$2  lμ  Q     "q μ3R C43" ̻ݡ:μ %μ:#μ@JΫ@nJ  ( @$]'5;F;EUPXfsF9M9jY:*xɬ^x B"3Ds24DD4we"OgR#2ODOf}vf$O0:wƆv4" vxgOO2kۈWOOg׈wD2vtD v{ayDO4D wig?DDD0*fiDDDBfCDDBD0+fg44DB$vgzsD35#D"wewCO3'#C YvhX3D37yCC2f333GwuC32Ua"3BVffCC" UZ2$2UVUD3" {0#2XQT30  # VQ$20"@"Q " ܠM@ 2"P=$޷{  (0'_'5;F;FVQXenD9jZM9x`rɬhΐ$ͤ 4DJ̶r0)Dgs3 dܷv4BkwfD0;fwhI*gvd93 kwxDDC VhIIDejDDC2Zgx34JSD%ghD340gwW3D5j3@WwQ#35fd43uUQ#35wWC2QV#UUC2{#uC l    3!ܠ*@@(  ( )"_) 4;F;EUJXi^Z`wD4h\I6xǩ¿Xs#R5D̘4@ɇ_%y hOBtDB[DGT%uCYS2CWt2a`"32g"2 k| %\ͦ h0 00 %    h00  Hh00   h 00h (?$HWB0 !!resource.hIDI_LUGARU104_APS_NEXT_RESOURCE_VALUE105 _APS_NEXT_COMMAND_VALUE40001 _APS_NEXT_CONTROL_VALUE1001 _APS_NEXT_SYMED_VALUE101!!afxres.h!winres.hVS_VERSION_INFO1IDC_STATIC(-1))!CBRS_ALIGN_LEFT0x1000L/CBRS_ALIGN_TOP0x2000L0CBRS_ALIGN_RIGHT0x4000L1CBRS_ALIGN_BOTTOM0x8000L2CBRS_ALIGN_ANY0xF000L3CBRS_BORDER_LEFT0x0100L5CBRS_BORDER_TOP0x0200L6CBRS_BORDER_RIGHT0x0400L7CBRS_BORDER_BOTTOM0x0800L8CBRS_BORDER_ANY0x0F00L9CBRS_TOOLTIPS0x0010L;CBRS_FLYBY0x0020L<CBRS_FLOAT_MULTI0x0040L=CBRS_BORDER_3D0x0080L>CBRS_HIDE_INPLACE0x0008L?CBRS_SIZE_DYNAMIC0x0004L@CBRS_SIZE_FIXED0x0002LACBRS_FLOATING0x0001LBCBRS_GRIPPER0x00400000LDCBRS_ORIENT_HORZ(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM)FCBRS_ORIENT_VERT(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT)GCBRS_ORIENT_ANY(CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT)HCBRS_ALL0x0040FFFFLJCBRS_NOALIGN0x00000000LOCBRS_LEFT(CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT)PCBRS_TOP(CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM)QCBRS_RIGHT(CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT)RCBRS_BOTTOM(CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP)SID_INDICATOR_EXT0xE700YID_INDICATOR_CAPS0xE701ZID_INDICATOR_NUM0xE702[ID_INDICATOR_SCRL0xE703\ID_INDICATOR_OVR0xE704]ID_INDICATOR_REC0xE705^ID_INDICATOR_KANA0xE706_ID_SEPARATOR0aAFX_IDS_APP_TITLE0xE000AFX_IDS_IDLEMESSAGE0xE001AFX_IDS_HELPMODEMESSAGE0xE002AFX_IDS_APP_TITLE_EMBEDDING0xE003AFX_IDS_COMPANY_NAME0xE004AFX_IDS_OBJ_TITLE_INPLACE0xE005ID_FILE_NEW0xE100ID_FILE_OPEN0xE101ID_FILE_CLOSE0xE102ID_FILE_SAVE0xE103ID_FILE_SAVE_AS0xE104ID_FILE_PAGE_SETUP0xE105ID_FILE_PRINT_SETUP0xE106ID_FILE_PRINT0xE107ID_FILE_PRINT_DIRECT0xE108ID_FILE_PRINT_PREVIEW0xE109ID_FILE_UPDATE0xE10AID_FILE_SAVE_COPY_AS0xE10BID_FILE_SEND_MAIL0xE10CID_FILE_NEW_FRAME0xE10DID_FILE_MRU_FIRST0xE110ID_FILE_MRU_FILE10xE110ID_FILE_MRU_FILE20xE111ID_FILE_MRU_FILE30xE112ID_FILE_MRU_FILE40xE113ID_FILE_MRU_FILE50xE114ID_FILE_MRU_FILE60xE115ID_FILE_MRU_FILE70xE116ID_FILE_MRU_FILE80xE117ID_FILE_MRU_FILE90xE118ID_FILE_MRU_FILE100xE119ID_FILE_MRU_FILE110xE11AID_FILE_MRU_FILE120xE11BID_FILE_MRU_FILE130xE11CID_FILE_MRU_FILE140xE11DID_FILE_MRU_FILE150xE11EID_FILE_MRU_FILE160xE11FID_FILE_MRU_LAST0xE11FID_EDIT_CLEAR0xE120ID_EDIT_CLEAR_ALL0xE121ID_EDIT_COPY0xE122ID_EDIT_CUT0xE123ID_EDIT_FIND0xE124ID_EDIT_PASTE0xE125ID_EDIT_PASTE_LINK0xE126ID_EDIT_PASTE_SPECIAL0xE127ID_EDIT_REPEAT0xE128ID_EDIT_REPLACE0xE129ID_EDIT_SELECT_ALL0xE12AID_EDIT_UNDO0xE12BID_EDIT_REDO0xE12CID_WINDOW_NEW0xE130ID_WINDOW_ARRANGE0xE131ID_WINDOW_CASCADE0xE132ID_WINDOW_TILE_HORZ0xE133ID_WINDOW_TILE_VERT0xE134ID_WINDOW_SPLIT0xE135ID_APP_ABOUT0xE140ID_APP_EXIT0xE141ID_HELP_INDEX0xE142ID_HELP_FINDER0xE143ID_HELP_USING0xE144ID_CONTEXT_HELP0xE145ID_HELP0xE146ID_DEFAULT_HELP0xE147ID_NEXT_PANE0xE150ID_PREV_PANE0xE151ID_FORMAT_FONT0xE160ID_OLE_INSERT_NEW0xE200ID_OLE_EDIT_LINKS0xE201ID_OLE_EDIT_CONVERT0xE202ID_OLE_EDIT_CHANGE_ICON0xE203ID_OLE_EDIT_PROPERTIES0xE204ID_OLE_VERB_FIRST0xE210AFX_ID_PREVIEW_CLOSE0xE300AFX_ID_PREVIEW_NUMPAGE0xE301AFX_ID_PREVIEW_NEXT0xE302AFX_ID_PREVIEW_PREV0xE303AFX_ID_PREVIEW_PRINT0xE304AFX_ID_PREVIEW_ZOOMIN0xE305AFX_ID_PREVIEW_ZOOMOUT0xE306ID_VIEW_TOOLBAR0xE800ID_VIEW_STATUS_BAR0xE801 ID_VIEW_REBAR0xE804 ID_VIEW_AUTOARRANGE0xE805 ID_VIEW_SMALLICON0xE810 ID_VIEW_LARGEICON0xE811ID_VIEW_LIST0xE812ID_VIEW_DETAILS0xE813ID_VIEW_LINEUP0xE814ID_VIEW_BYNAME0xE815AFX_ID_VIEW_MINIMUMID_VIEW_SMALLICONAFX_ID_VIEW_MAXIMUMID_VIEW_BYNAMEID_RECORD_FIRST0xE900ID_RECORD_LAST0xE901ID_RECORD_NEXT0xE902ID_RECORD_PREV0xE903IDC_STATIC(-1)#AFX_IDS_SCSIZE0xEF00,AFX_IDS_SCMOVE0xEF01-AFX_IDS_SCMINIMIZE0xEF02.AFX_IDS_SCMAXIMIZE0xEF03/AFX_IDS_SCNEXTWINDOW0xEF040AFX_IDS_SCPREVWINDOW0xEF051AFX_IDS_SCCLOSE0xEF062AFX_IDS_SCRESTORE0xEF123AFX_IDS_SCTASKLIST0xEF134AFX_IDS_MDICHILD0xEF1F6AFX_IDS_DESKACCESSORY0xEFDA8AFX_IDS_OPENFILE0xF000;AFX_IDS_SAVEFILE0xF001<AFX_IDS_ALLFILTER0xF002=AFX_IDS_UNTITLED0xF003>AFX_IDS_SAVEFILECOPY0xF004?AFX_IDS_PREVIEW_CLOSE0xF005@AFX_IDS_UNNAMED_FILE0xF006AAFX_IDS_HIDE0xF011BAFX_IDP_NO_ERROR_AVAILABLE0xF020EAFX_IDS_NOT_SUPPORTED_EXCEPTION0xF021FAFX_IDS_RESOURCE_EXCEPTION0xF022GAFX_IDS_MEMORY_EXCEPTION0xF023HAFX_IDS_USER_EXCEPTION0xF024IAFX_IDS_INVALID_ARG_EXCEPTION0xF025JAFX_IDS_PRINTONPORT0xF040MAFX_IDS_ONEPAGE0xF041NAFX_IDS_TWOPAGE0xF042OAFX_IDS_PRINTPAGENUM0xF043PAFX_IDS_PREVIEWPAGEDESC0xF044QAFX_IDS_PRINTDEFAULTEXT0xF045RAFX_IDS_PRINTDEFAULT0xF046SAFX_IDS_PRINTFILTER0xF047TAFX_IDS_PRINTCAPTION0xF048UAFX_IDS_PRINTTOFILE0xF049VAFX_IDS_OBJECT_MENUITEM0xF080ZAFX_IDS_EDIT_VERB0xF081[AFX_IDS_ACTIVATE_VERB0xF082\AFX_IDS_CHANGE_LINK0xF083]AFX_IDS_AUTO0xF084^AFX_IDS_MANUAL0xF085_AFX_IDS_FROZEN0xF086`AFX_IDS_ALL_FILES0xF087aAFX_IDS_SAVE_MENU0xF088cAFX_IDS_UPDATE_MENU0xF089dAFX_IDS_SAVE_AS_MENU0xF08AeAFX_IDS_SAVE_COPY_AS_MENU0xF08BfAFX_IDS_EXIT_MENU0xF08CgAFX_IDS_UPDATING_ITEMS0xF08DhAFX_IDS_METAFILE_FORMAT0xF08EjAFX_IDS_DIB_FORMAT0xF08FkAFX_IDS_BITMAP_FORMAT0xF090lAFX_IDS_LINKSOURCE_FORMAT0xF091mAFX_IDS_EMBED_FORMAT0xF092nAFX_IDS_PASTELINKEDTYPE0xF094pAFX_IDS_UNKNOWNTYPE0xF095qAFX_IDS_RTF_FORMAT0xF096rAFX_IDS_TEXT_FORMAT0xF097sAFX_IDS_INVALID_CURRENCY0xF098uAFX_IDS_INVALID_DATETIME0xF099vAFX_IDS_INVALID_DATETIMESPAN0xF09AwAFX_IDP_INVALID_FILENAME0xF100zAFX_IDP_FAILED_TO_OPEN_DOC0xF101{AFX_IDP_FAILED_TO_SAVE_DOC0xF102|AFX_IDP_ASK_TO_SAVE0xF103}AFX_IDP_FAILED_TO_CREATE_DOC0xF104~AFX_IDP_FILE_TOO_LARGE0xF105AFX_IDP_FAILED_TO_START_PRINT0xF106AFX_IDP_FAILED_TO_LAUNCH_HELP0xF107AFX_IDP_INTERNAL_FAILURE0xF108AFX_IDP_COMMAND_FAILURE0xF109AFX_IDP_FAILED_MEMORY_ALLOC0xF10AAFX_IDP_UNREG_DONE0xF10BAFX_IDP_UNREG_FAILURE0xF10CAFX_IDP_DLL_LOAD_FAILED0xF10DAFX_IDP_DLL_BAD_VERSION0xF10EAFX_IDP_PARSE_INT0xF110AFX_IDP_PARSE_REAL0xF111AFX_IDP_PARSE_INT_RANGE0xF112AFX_IDP_PARSE_REAL_RANGE0xF113AFX_IDP_PARSE_STRING_SIZE0xF114AFX_IDP_PARSE_RADIO_BUTTON0xF115AFX_IDP_PARSE_BYTE0xF116AFX_IDP_PARSE_UINT0xF117AFX_IDP_PARSE_DATETIME0xF118AFX_IDP_PARSE_CURRENCY0xF119AFX_IDP_PARSE_GUID0xF11AAFX_IDP_PARSE_TIME0xF11BAFX_IDP_PARSE_DATE0xF11CAFX_IDP_FAILED_INVALID_FORMAT0xF120AFX_IDP_FAILED_INVALID_PATH0xF121AFX_IDP_FAILED_DISK_FULL0xF122AFX_IDP_FAILED_ACCESS_READ0xF123AFX_IDP_FAILED_ACCESS_WRITE0xF124AFX_IDP_FAILED_IO_ERROR_READ0xF125AFX_IDP_FAILED_IO_ERROR_WRITE0xF126AFX_IDP_SCRIPT_ERROR0xF130AFX_IDP_SCRIPT_DISPATCH_EXCEPTION0xF131AFX_IDP_STATIC_OBJECT0xF180AFX_IDP_FAILED_TO_CONNECT0xF181AFX_IDP_SERVER_BUSY0xF182AFX_IDP_BAD_VERB0xF183AFX_IDS_NOT_DOCOBJECT0xF184AFX_IDP_FAILED_TO_NOTIFY0xF185AFX_IDP_FAILED_TO_LAUNCH0xF186AFX_IDP_ASK_TO_UPDATE0xF187AFX_IDP_FAILED_TO_UPDATE0xF188AFX_IDP_FAILED_TO_REGISTER0xF189AFX_IDP_FAILED_TO_AUTO_REGISTER0xF18AAFX_IDP_FAILED_TO_CONVERT0xF18BAFX_IDP_GET_NOT_SUPPORTED0xF18CAFX_IDP_SET_NOT_SUPPORTED0xF18DAFX_IDP_ASK_TO_DISCARD0xF18EAFX_IDP_FAILED_TO_CREATE0xF18FAFX_IDP_FAILED_MAPI_LOAD0xF190AFX_IDP_INVALID_MAPI_DLL0xF191AFX_IDP_FAILED_MAPI_SEND0xF192AFX_IDP_FILE_NONE0xF1A0AFX_IDP_FILE_GENERIC0xF1A1AFX_IDP_FILE_NOT_FOUND0xF1A2AFX_IDP_FILE_BAD_PATH0xF1A3AFX_IDP_FILE_TOO_MANY_OPEN0xF1A4AFX_IDP_FILE_ACCESS_DENIED0xF1A5AFX_IDP_FILE_INVALID_FILE0xF1A6AFX_IDP_FILE_REMOVE_CURRENT0xF1A7AFX_IDP_FILE_DIR_FULL0xF1A8AFX_IDP_FILE_BAD_SEEK0xF1A9AFX_IDP_FILE_HARD_IO0xF1AAAFX_IDP_FILE_SHARING0xF1ABAFX_IDP_FILE_LOCKING0xF1ACAFX_IDP_FILE_DISKFULL0xF1ADAFX_IDP_FILE_EOF0xF1AEAFX_IDP_ARCH_NONE0xF1B0AFX_IDP_ARCH_GENERIC0xF1B1AFX_IDP_ARCH_READONLY0xF1B2AFX_IDP_ARCH_ENDOFFILE0xF1B3AFX_IDP_ARCH_WRITEONLY0xF1B4AFX_IDP_ARCH_BADINDEX0xF1B5AFX_IDP_ARCH_BADCLASS0xF1B6AFX_IDP_ARCH_BADSCHEMA0xF1B7AFX_IDS_OCC_SCALEUNITS_PIXELS0xF1C0AFX_IDS_STATUS_FONT0xF230AFX_IDS_TOOLTIP_FONT0xF231AFX_IDS_UNICODE_FONT0xF232AFX_IDS_MINI_FONT0xF233AFX_IDP_SQL_CONNECT_FAIL0xF281AFX_IDP_SQL_RECORDSET_FORWARD_ONLY0xF282AFX_IDP_SQL_EMPTY_COLUMN_LIST0xF283AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH0xF284AFX_IDP_SQL_ILLEGAL_MODE0xF285AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED0xF286AFX_IDP_SQL_NO_CURRENT_RECORD0xF287AFX_IDP_SQL_NO_ROWS_AFFECTED0xF288AFX_IDP_SQL_RECORDSET_READONLY0xF289AFX_IDP_SQL_SQL_NO_TOTAL0xF28AAFX_IDP_SQL_ODBC_LOAD_FAILED0xF28BAFX_IDP_SQL_DYNASET_NOT_SUPPORTED0xF28CAFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED0xF28DAFX_IDP_SQL_API_CONFORMANCE0xF28EAFX_IDP_SQL_SQL_CONFORMANCE0xF28FAFX_IDP_SQL_NO_DATA_FOUND0xF290AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED0xF291AFX_IDP_SQL_ODBC_V2_REQUIRED0xF292AFX_IDP_SQL_NO_POSITIONED_UPDATES0xF293AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED0xF294AFX_IDP_SQL_DATA_TRUNCATED0xF295AFX_IDP_SQL_ROW_FETCH0xF296AFX_IDP_SQL_INCORRECT_ODBC0xF297AFX_IDP_SQL_UPDATE_DELETE_FAILED0xF298AFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED0xF299AFX_IDP_SQL_FIELD_NOT_FOUND0xF29AAFX_IDP_SQL_BOOKMARKS_NOT_SUPPORTED0xF29BAFX_IDP_SQL_BOOKMARKS_NOT_ENABLED0xF29CAFX_IDS_DELETED0xF29DAFX_IDP_DAO_ENGINE_INITIALIZATION0xF2B0AFX_IDP_DAO_DFX_BIND0xF2B1 AFX_IDP_DAO_OBJECT_NOT_OPEN0xF2B2 AFX_IDP_DAO_ROWTOOSHORT0xF2B3AFX_IDP_DAO_BADBINDINFO0xF2B4AFX_IDP_DAO_COLUMNUNAVAILABLE0xF2B5AFX_IDS_HTTP_TITLE0xF2D1AFX_IDS_HTTP_NO_TEXT0xF2D2AFX_IDS_HTTP_BAD_REQUEST0xF2D3AFX_IDS_HTTP_AUTH_REQUIRED0xF2D4AFX_IDS_HTTP_FORBIDDEN0xF2D5AFX_IDS_HTTP_NOT_FOUND0xF2D6AFX_IDS_HTTP_SERVER_ERROR0xF2D7AFX_IDS_HTTP_NOT_IMPLEMENTED0xF2D8AFX_IDS_CHECKLISTBOX_UNCHECK0xF2E1!AFX_IDS_CHECKLISTBOX_CHECK0xF2E2"AFX_IDS_CHECKLISTBOX_MIXED0xF2E3#AFX_IDC_LISTBOX100)AFX_IDC_CHANGE101*AFX_IDC_BROWSER102+AFX_IDC_PRINT_DOCNAME201.AFX_IDC_PRINT_PRINTERNAME202/AFX_IDC_PRINT_PORTNAME2030AFX_IDC_PRINT_PAGENUM2041ID_APPLY_NOW0x30214ID_WIZBACK0x30235ID_WIZNEXT0x30246ID_WIZFINISH0x30257AFX_IDC_TAB_CONTROL0x30208AFX_IDD_NEWTYPEDLG30721KAFX_IDD_PRINTDLG30722LAFX_IDD_PREVIEW_TOOLBAR30723MAFX_IDD_INSERTOBJECT30724PAFX_IDD_CHANGEICON30725QAFX_IDD_CONVERT30726RAFX_IDD_PASTESPECIAL30727SAFX_IDD_EDITLINKS30728TAFX_IDD_FILEBROWSE30729UAFX_IDD_BUSY30730VAFX_IDD_OBJECTPROPERTIES30732XAFX_IDD_CHANGESOURCE30733YAFX_IDC_CONTEXTHELP30977]AFX_IDC_MAGNIFY30978^AFX_IDC_SMALLARROWS30979_AFX_IDC_HSPLITBAR30980`AFX_IDC_VSPLITBAR30981aAFX_IDC_NODROPCRSR30982bAFX_IDC_TRACKNWSE30983cAFX_IDC_TRACKNESW30984dAFX_IDC_TRACKNS30985eAFX_IDC_TRACKWE30986fAFX_IDC_TRACK4WAY30987gAFX_IDC_MOVE4WAY30988hAFX_IDC_MOUSE_PAN_NW30998lAFX_IDC_MOUSE_PAN_N30999mAFX_IDC_MOUSE_PAN_NE31000nAFX_IDC_MOUSE_PAN_W31001oAFX_IDC_MOUSE_PAN_HV31002pAFX_IDC_MOUSE_PAN_E31003qAFX_IDC_MOUSE_PAN_SW31004rAFX_IDC_MOUSE_PAN_S31005sAFX_IDC_MOUSE_PAN_SE31006tAFX_IDC_MOUSE_PAN_HORZ31007uAFX_IDC_MOUSE_PAN_VERT31008vAFX_IDC_MOUSE_ORG_HORZ31009yAFX_IDC_MOUSE_ORG_VERT31010zAFX_IDC_MOUSE_ORG_HV31011{AFX_IDC_MOUSE_MASK31012|AFX_IDB_MINIFRAME_MENU30994AFX_IDB_CHECKLISTBOX_9530996AFX_IDR_PREVIEW_ACCEL30997AFX_IDI_STD_MDIFRAME31233AFX_IDI_STD_FRAME31234AFX_IDC_FONTPROP1000AFX_IDC_FONTNAMES1001AFX_IDC_FONTSTYLES1002AFX_IDC_FONTSIZES1003AFX_IDC_STRIKEOUT1004AFX_IDC_UNDERLINE1005AFX_IDC_SAMPLEBOX1006AFX_IDC_COLOR_BLACK1100AFX_IDC_COLOR_WHITE1101AFX_IDC_COLOR_RED1102AFX_IDC_COLOR_GREEN1103AFX_IDC_COLOR_BLUE1104AFX_IDC_COLOR_YELLOW1105AFX_IDC_COLOR_MAGENTA1106AFX_IDC_COLOR_CYAN1107AFX_IDC_COLOR_GRAY1108AFX_IDC_COLOR_LIGHTGRAY1109AFX_IDC_COLOR_DARKRED1110AFX_IDC_COLOR_DARKGREEN1111AFX_IDC_COLOR_DARKBLUE1112AFX_IDC_COLOR_LIGHTBROWN1113AFX_IDC_COLOR_DARKMAGENTA1114AFX_IDC_COLOR_DARKCYAN1115AFX_IDC_COLORPROP1116AFX_IDC_SYSTEMCOLORS1117AFX_IDC_PROPNAME1201AFX_IDC_PICTURE1202AFX_IDC_BROWSE1203AFX_IDC_CLEAR1204AFX_IDD_PROPPAGE_COLOR32257AFX_IDD_PROPPAGE_FONT32258AFX_IDD_PROPPAGE_PICTURE32259AFX_IDB_TRUETYPE32384AFX_IDS_PROPPAGE_UNKNOWN0xFE01AFX_IDS_COLOR_DESKTOP0xFE04AFX_IDS_COLOR_APPWORKSPACE0xFE05AFX_IDS_COLOR_WNDBACKGND0xFE06AFX_IDS_COLOR_WNDTEXT0xFE07AFX_IDS_COLOR_MENUBAR0xFE08AFX_IDS_COLOR_MENUTEXT0xFE09AFX_IDS_COLOR_ACTIVEBAR0xFE0AAFX_IDS_COLOR_INACTIVEBAR0xFE0BAFX_IDS_COLOR_ACTIVETEXT0xFE0CAFX_IDS_COLOR_INACTIVETEXT0xFE0DAFX_IDS_COLOR_ACTIVEBORDER0xFE0EAFX_IDS_COLOR_INACTIVEBORDER0xFE0FAFX_IDS_COLOR_WNDFRAME0xFE10AFX_IDS_COLOR_SCROLLBARS0xFE11AFX_IDS_COLOR_BTNFACE0xFE12AFX_IDS_COLOR_BTNSHADOW0xFE13AFX_IDS_COLOR_BTNTEXT0xFE14AFX_IDS_COLOR_BTNHIGHLIGHT0xFE15AFX_IDS_COLOR_DISABLEDTEXT0xFE16AFX_IDS_COLOR_HIGHLIGHT0xFE17AFX_IDS_COLOR_HIGHLIGHTTEXT0xFE18AFX_IDS_REGULAR0xFE19AFX_IDS_BOLD0xFE1AAFX_IDS_ITALIC0xFE1BAFX_IDS_BOLDITALIC0xFE1CAFX_IDS_SAMPLETEXT0xFE1DAFX_IDS_DISPLAYSTRING_FONT0xFE1EAFX_IDS_DISPLAYSTRING_COLOR0xFE1FAFX_IDS_DISPLAYSTRING_PICTURE0xFE20AFX_IDS_PICTUREFILTER0xFE21AFX_IDS_PICTYPE_UNKNOWN0xFE22AFX_IDS_PICTYPE_NONE0xFE23AFX_IDS_PICTYPE_BITMAP0xFE24AFX_IDS_PICTYPE_METAFILE0xFE25AFX_IDS_PICTYPE_ICON0xFE26AFX_IDS_COLOR_PPG0xFE28AFX_IDS_COLOR_PPG_CAPTION0xFE29AFX_IDS_FONT_PPG0xFE2AAFX_IDS_FONT_PPG_CAPTION0xFE2BAFX_IDS_PICTURE_PPG0xFE2CAFX_IDS_PICTURE_PPG_CAPTION0xFE2DAFX_IDS_PICTUREBROWSETITLE0xFE30AFX_IDS_BORDERSTYLE_00xFE31AFX_IDS_BORDERSTYLE_10xFE32AFX_IDS_VERB_EDIT0xFE40AFX_IDS_VERB_PROPERTIES0xFE41AFX_IDP_PICTURECANTOPEN0xFE83AFX_IDP_PICTURECANTLOAD0xFE84AFX_IDP_PICTURETOOLARGE0xFE85AFX_IDP_PICTUREREADFAILED0xFE86AFX_IDP_E_ILLEGALFUNCTIONCALL0xFEA0AFX_IDP_E_OVERFLOW0xFEA1AFX_IDP_E_OUTOFMEMORY0xFEA2AFX_IDP_E_DIVISIONBYZERO0xFEA3AFX_IDP_E_OUTOFSTRINGSPACE0xFEA4AFX_IDP_E_OUTOFSTACKSPACE0xFEA5AFX_IDP_E_BADFILENAMEORNUMBER0xFEA6AFX_IDP_E_FILENOTFOUND0xFEA7AFX_IDP_E_BADFILEMODE0xFEA8AFX_IDP_E_FILEALREADYOPEN0xFEA9AFX_IDP_E_DEVICEIOERROR0xFEAAAFX_IDP_E_FILEALREADYEXISTS0xFEABAFX_IDP_E_BADRECORDLENGTH0xFEACAFX_IDP_E_DISKFULL0xFEADAFX_IDP_E_BADRECORDNUMBER0xFEAEAFX_IDP_E_BADFILENAME0xFEAFAFX_IDP_E_TOOMANYFILES0xFEB0AFX_IDP_E_DEVICEUNAVAILABLE0xFEB1 AFX_IDP_E_PERMISSIONDENIED0xFEB2 AFX_IDP_E_DISKNOTREADY0xFEB3 AFX_IDP_E_PATHFILEACCESSERROR0xFEB4 AFX_IDP_E_PATHNOTFOUND0xFEB5 AFX_IDP_E_INVALIDPATTERNSTRING0xFEB6AFX_IDP_E_INVALIDUSEOFNULL0xFEB7AFX_IDP_E_INVALIDFILEFORMAT0xFEB8AFX_IDP_E_INVALIDPROPERTYVALUE0xFEB9AFX_IDP_E_INVALIDPROPERTYARRAYINDEX0xFEBAAFX_IDP_E_SETNOTSUPPORTEDATRUNTIME0xFEBBAFX_IDP_E_SETNOTSUPPORTED0xFEBCAFX_IDP_E_NEEDPROPERTYARRAYINDEX0xFEBDAFX_IDP_E_SETNOTPERMITTED0xFEBEAFX_IDP_E_GETNOTSUPPORTEDATRUNTIME0xFEBFAFX_IDP_E_GETNOTSUPPORTED0xFEC0AFX_IDP_E_PROPERTYNOTFOUND0xFEC1AFX_IDP_E_INVALIDCLIPBOARDFORMAT0xFEC2AFX_IDP_E_INVALIDPICTURE0xFEC3AFX_IDP_E_PRINTERERROR0xFEC4AFX_IDP_E_CANTSAVEFILETOTEMP0xFEC5AFX_IDP_E_SEARCHTEXTNOTFOUND0xFEC6AFX_IDP_E_REPLACEMENTSTOOLONG0xFEC7!!$HWB0  f:\Revelation\Development\LugaruPorting\Lugaru Port files\New build (pc port) - gwc\Source\res\resource.h D:\Microsoft\Visual Studio .NET 2003\Vc7\atlmfc\include/afxres.h D:\Microsoft\Visual Studio .NET 2003\Vc7\atlmfc\include/winres.hh lugaru.ico$HWB0 TEXTINCLUDE1$TEXTINCLUDE2$TEXTINCLUDE3$14104IDI_LUGARUf:\Revelation\Development\LugaruPorting\Lugaru Port files\New build (pc port) - gwc\Source\res\Lugaru.rc9$$L$HWB0 mDHWB  TEXTINCLUDE0 (TEXTINCLUDE0 tTEXTINCLUDE0 %  `'  (4 h= XB  _ Hk hPs v    h  hP  hؚ  ` h (p h0 ?ĨHWB0 |HWB0 HWB0 lugaru-0~20110520.1+hge4354.orig/Source/win-res/icon2.ico0000644000000000000000000000416611571222446020743 0ustar rootroot &h( @( ʦ """)))UUUMMMBBB999|PP3f3333f333ff3fffff3f3f̙f3333f3333333333f3333333f3f33ff3f3f3f3333f3333333f3̙33333f333ff3ffffff3f33f3ff3f3f3ffff3fffffffff3fffffff3f̙ffff3ff333f3ff33fff33f3ff̙3f3f3333f333ff3fffff̙̙3̙f̙̙̙3f̙3f3f3333f333ff3fffff3f3f̙3ffffffffff!___wwwm nmJ nsm fmnn톴JmJJf굵JCeCDJꮮCff<fffCffCCfm Cfff BERNIGAUD This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _Account_H_ #define _Account_H_ #include #include #include #include struct CampaignProgress { float highscore; float fasttime; float score; float time; std::vector choices; CampaignProgress() { highscore = 0; fasttime = 0; score = 0; time = 0; } }; class Account { public: static void destroy(int i); static Account* destroy(Account* a); static Account* add(std::string name); static Account* get(int i); static Account* loadFile(std::string filename); static void saveFile(std::string filename, Account* accountactive); static int indice(Account* a); void endGame(); void winCampaignLevel(int choice, float score, float time); void winLevel(int level, float score, float time); // getter and setters int getDifficulty(); void setDifficulty(int i) { difficulty = i; }; const char* getName() { return name.c_str(); }; float getCampaignScore() { return campaignProgress[currentCampaign].score; }; int getCampaignChoicesMade() { return campaignProgress[currentCampaign].choices.size(); }; int getCampaignChoice(int i) { return campaignProgress[currentCampaign].choices[i]; }; void setCampaignScore(int s) { campaignProgress[currentCampaign].score=s; if(s>campaignProgress[currentCampaign].highscore) campaignProgress[currentCampaign].highscore=s; }; void setCampaignFinalTime(float t) { campaignProgress[currentCampaign].time = t; if((t campaignProgress; //statics static std::vector accounts; }; #endif lugaru-0~20110520.1+hge4354.orig/Source/Animation.h0000644000000000000000000000303311571222446017731 0ustar rootroot/* Copyright (C) 2010 - Lugaru authors This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ANIMATION_H #define ANIMATION_H enum anim_attack_type { neutral, normalattack, reversed, reversal }; enum anim_height_type { lowheight, middleheight, highheight }; enum animation_types { #define DECLARE_ANIM(id, ...) id, #include "Animation.def" #undef DECLARE_ANIM animation_count }; enum animation_bit_offsets { #define DECLARE_ANIM_BIT(bit) o_##bit, #include "Animation.def" #undef DECLARE_ANIM_BIT animation_bit_count }; enum animation_bits_def { #define DECLARE_ANIM_BIT(bit) bit = 1 << o_##bit, #include "Animation.def" #undef DECLARE_ANIM_BIT }; static const int animation_bits[animation_count] = { #define DECLARE_ANIM(id, name, height, type, bits) bits, #include "Animation.def" #undef DECLARE_ANIM }; extern Animation animation[animation_count]; extern void loadAllAnimations(); #endif lugaru-0~20110520.1+hge4354.orig/Source/GameInitDispose.cpp0000644000000000000000000007073111571222446021402 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Game.h" #include "openal_wrapper.h" #include "Animation.h" #include "Texture.h" extern float screenwidth,screenheight; extern float viewdistance; extern XYZ viewer; extern XYZ lightlocation; extern float lightambient[3],lightbrightness[3]; extern float fadestart; extern float texscale; extern float gravity; extern Light light; extern Skeleton testskeleton; extern int numsounds; extern Terrain terrain; //extern Sprites sprites; extern int kTextureSize; extern float texdetail; extern float realtexdetail; extern float volume; extern Objects objects; extern int detail; extern bool cellophane; extern GLubyte bloodText[512*512*3]; extern GLubyte wolfbloodText[512*512*3]; extern bool ismotionblur; extern bool trilinear; extern bool osx; extern bool musictoggle; extern int environment; extern bool ambientsound; extern float multiplier; extern int netdatanew; extern float mapinfo; extern bool stillloading; extern TGAImageRec texture; extern short vRefNum; extern long dirID; extern int mainmenu; extern int oldmainmenu; extern bool visibleloading; extern float flashamount,flashr,flashg,flashb; extern int flashdelay; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; extern int difficulty; extern float tintr,tintg,tintb; extern float slomospeed; extern bool gamestarted; extern int numdialogues; extern int numdialogueboxes[20]; extern int dialoguetype[20]; extern int dialogueboxlocation[20][20]; extern float dialogueboxcolor[20][20][3]; extern int dialogueboxsound[20][20]; extern char dialoguetext[20][20][128]; extern char dialoguename[20][20][64]; extern XYZ dialoguecamera[20][20]; extern float dialoguecamerarotation[20][20]; extern float dialoguecamerarotation2[20][20]; extern int indialogue; extern int whichdialogue; extern float dialoguetime; extern float accountcampaignhighscore[10]; extern float accountcampaignfasttime[10]; extern float accountcampaignscore[10]; extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; void LOG(const std::string &fmt, ...) { // !!! FIXME: write me. } void Game::Dispose() { LOGFUNC; if(endgame==2){ accountactive->endGame(); endgame=0; } Account::saveFile(":Data:Users", accountactive); //textures.clear(); LOG("Shutting down sound system..."); OPENAL_StopSound(OPENAL_ALL); // this is causing problems on Linux, but we'll force an _exit() a little // later in the shutdown process. --ryan. #if !PLATFORM_LINUX for (int i=0; i < sounds_count; ++i) { OPENAL_Sample_Free(samp[i]); } OPENAL_Close(); if (texture.data) { free(texture.data); } texture.data = 0; #endif } void Game::LoadTexture(const string fileName, GLuint *textureid,int mipmap, bool hasalpha) { *textureid = Texture::Load(fileName,mipmap,hasalpha); } void Game::LoadTextureSave(const string fileName, GLuint *textureid,int mipmap,GLubyte *array, int *skinsize) { *textureid = Texture::Load(fileName,mipmap,false,array,skinsize); } void Game::LoadSave(const char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize) { int i; int bytesPerPixel; LOGFUNC; LOG(std::string("Loading (S)...") + fileName); //Load Image float temptexdetail=texdetail; texdetail=1; //upload_image( fileName ); //LoadTGA( fileName ); // Converting file to something os specific char * fixedFN = ConvertFileName(fileName); //Load Image unsigned char fileNamep[256]; CopyCStringToPascal(fixedFN, fileNamep); //Load Image upload_image( fileNamep ,0); texdetail=temptexdetail; //Is it valid? if(1==1){ bytesPerPixel=texture.bpp/8; int tempnum=0; for(i=0;i<(int)(texture.sizeY*texture.sizeX*bytesPerPixel);i++){ if((i+1)%4||bytesPerPixel==3){ array[tempnum]=texture.data[i]; tempnum++; } } } } bool Game::AddClothes(const char *fileName, GLubyte *array) { int i; int bytesPerPixel; LOGFUNC; //upload_image( fileName ); //LoadTGA( fileName ); //Load Image unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image bool opened; opened=upload_image( fileNamep ,1); float alphanum; //Is it valid? if(opened){ if(tintr>1)tintr=1; if(tintg>1)tintg=1; if(tintb>1)tintb=1; if(tintr<0)tintr=0; if(tintg<0)tintg=0; if(tintb<0)tintb=0; bytesPerPixel=texture.bpp/8; int tempnum=0; alphanum=255; for(i=0;i<(int)(texture.sizeY*texture.sizeX*bytesPerPixel);i++){ if(bytesPerPixel==3)alphanum=255; else if((i+1)%4==0)alphanum=texture.data[i]; //alphanum/=2; if((i+1)%4||bytesPerPixel==3){ if((i%4)==0)texture.data[i]*=tintr; if((i%4)==1)texture.data[i]*=tintg; if((i%4)==2)texture.data[i]*=tintb; array[tempnum]=(float)array[tempnum]*(1-alphanum/255)+(float)texture.data[i]*(alphanum/255); tempnum++; } } } else return 0; return 1; } //***************> ResizeGLScene() <******/ GLvoid Game::ReSizeGLScene(float fov, float pnear) { if (screenheight==0) { screenheight=1; } glViewport(0,0,screenwidth,screenheight); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(fov,(GLfloat)screenwidth/(GLfloat)screenheight,pnear,viewdistance); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void Game::LoadingScreen() { static float loadprogress; static AbsoluteTime time = {0,0}; static AbsoluteTime frametime = {0,0}; AbsoluteTime currTime = UpTime (); double deltaTime = (float) AbsoluteDeltaToDuration (currTime, frametime); if (0 > deltaTime) // if negative microseconds deltaTime /= -1000000.0; else // else milliseconds deltaTime /= 1000.0; multiplier=deltaTime; if(multiplier<.001)multiplier=.001; if(multiplier>10)multiplier=10; if(multiplier>.05){ frametime = currTime; // reset for next time interval glLoadIdentity(); //Clear to black glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); loadtime+=multiplier*4; loadprogress=loadtime; if(loadprogress>100)loadprogress=100; //loadprogress=abs(Random()%100); //Background glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, loadscreentexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glScalef((float)screenwidth/2,(float)screenheight/2,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_BLEND); glColor4f(loadprogress/100,loadprogress/100,loadprogress/100,1); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3); glVertex3f(-1, -1, 0.0f); glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3); glVertex3f(1, -1, 0.0f); glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3); glVertex3f(1, 1, 0.0f); glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glEnable(GL_BLEND); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(.4+loadprogress/100,0+loadprogress/100); glVertex3f(-1, -1, 0.0f); glTexCoord2f(.4+loadprogress/100,0+loadprogress/100); glVertex3f(1, -1, 0.0f); glTexCoord2f(.4+loadprogress/100,1+loadprogress/100); glVertex3f(1, 1, 0.0f); glTexCoord2f(.4+loadprogress/100,1+loadprogress/100); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glDisable(GL_BLEND); glDepthMask(1); glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, loadscreentexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glScalef((float)screenwidth/2*(1.5-(loadprogress)/200),(float)screenheight/2*(1.5-(loadprogress)/200),1); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glEnable(GL_BLEND); //glColor4f(loadprogress/100,loadprogress/100,loadprogress/100,1); glColor4f(loadprogress/100,loadprogress/100,loadprogress/100,1); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0+.5,0+.5); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1+.5,0+.5); glVertex3f(1, -1, 0.0f); glTexCoord2f(1+.5,1+.5); glVertex3f(1, 1, 0.0f); glTexCoord2f(0+.5,1+.5); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glDisable(GL_BLEND); glDepthMask(1); glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, loadscreentexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glScalef((float)screenwidth/2*(100+loadprogress)/100,(float)screenheight/2*(100+loadprogress)/100,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glEnable(GL_BLEND); glColor4f(loadprogress/100,loadprogress/100,loadprogress/100,.4); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0+.2,0+.8); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1+.2,0+.8); glVertex3f(1, -1, 0.0f); glTexCoord2f(1+.2,1+.8); glVertex3f(1, 1, 0.0f); glTexCoord2f(0+.2,1+.8); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glDisable(GL_BLEND); glDepthMask(1); //Text if(flashamount>0){ if(flashamount>1)flashamount=1; if(flashdelay<=0)flashamount-=multiplier; flashdelay--; if(flashamount<0)flashamount=0; glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(flashr,flashg,flashb,flashamount); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } swap_gl_buffers(); } } void Game::FadeLoadingScreen(float howmuch) { static float loadprogress; glLoadIdentity(); //Clear to black glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); loadprogress=howmuch; //loadprogress=abs(Random()%100); //Background //glEnable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D); //glBindTexture( GL_TEXTURE_2D, loadscreentexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glScalef((float)screenwidth/2,(float)screenheight/2,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_BLEND); glColor4f(loadprogress/100,0,0,1); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glDisable(GL_BLEND); glDepthMask(1); //Text swap_gl_buffers(); } void Game::InitGame() { #if PLATFORM_MACOSX ProcessSerialNumber PSN; ProcessInfoRec pinfo; FSSpec pspec; OSStatus err; /* set up process serial number */ PSN.highLongOfPSN = 0; PSN.lowLongOfPSN = kCurrentProcess; /* set up info block */ pinfo.processInfoLength = sizeof(pinfo); pinfo.processName = NULL; pinfo.processAppSpec = &pspec; /* grab the vrefnum and directory */ err = GetProcessInformation(&PSN, &pinfo); if (err == noErr) { vRefNum = pspec.vRefNum; dirID = pspec.parID; } #endif LOGFUNC; autocam=0; numchallengelevels=14; accountactive=Account::loadFile(":Data:Users"); tintr=1; tintg=1; tintb=1; whichjointstartarray[0]=righthip; whichjointendarray[0]=rightfoot; whichjointstartarray[1]=righthip; whichjointendarray[1]=rightankle; whichjointstartarray[2]=righthip; whichjointendarray[2]=rightknee; whichjointstartarray[3]=rightknee; whichjointendarray[3]=rightankle; whichjointstartarray[4]=rightankle; whichjointendarray[4]=rightfoot; whichjointstartarray[5]=lefthip; whichjointendarray[5]=leftfoot; whichjointstartarray[6]=lefthip; whichjointendarray[6]=leftankle; whichjointstartarray[7]=lefthip; whichjointendarray[7]=leftknee; whichjointstartarray[8]=leftknee; whichjointendarray[8]=leftankle; whichjointstartarray[9]=leftankle; whichjointendarray[9]=leftfoot; whichjointstartarray[10]=abdomen; whichjointendarray[10]=rightshoulder; whichjointstartarray[11]=abdomen; whichjointendarray[11]=rightelbow; whichjointstartarray[12]=abdomen; whichjointendarray[12]=rightwrist; whichjointstartarray[13]=abdomen; whichjointendarray[13]=righthand; whichjointstartarray[14]=rightshoulder; whichjointendarray[14]=rightelbow; whichjointstartarray[15]=rightelbow; whichjointendarray[15]=rightwrist; whichjointstartarray[16]=rightwrist; whichjointendarray[16]=righthand; whichjointstartarray[17]=abdomen; whichjointendarray[17]=leftshoulder; whichjointstartarray[18]=abdomen; whichjointendarray[18]=leftelbow; whichjointstartarray[19]=abdomen; whichjointendarray[19]=leftwrist; whichjointstartarray[20]=abdomen; whichjointendarray[20]=lefthand; whichjointstartarray[21]=leftshoulder; whichjointendarray[21]=leftelbow; whichjointstartarray[22]=leftelbow; whichjointendarray[22]=leftwrist; whichjointstartarray[23]=leftwrist; whichjointendarray[23]=lefthand; whichjointstartarray[24]=abdomen; whichjointendarray[24]=neck; whichjointstartarray[25]=neck; whichjointendarray[25]=head; FadeLoadingScreen(0); stillloading=1; texture.data = ( GLubyte* )malloc( 1024*1024*4 ); int temptexdetail=texdetail; texdetail=1; text.LoadFontTexture(":Data:Textures:Font.png"); text.BuildFont(); texdetail=temptexdetail; FadeLoadingScreen(10); if(detail==2){ texdetail=1; } if(detail==1){ texdetail=2; } if(detail==0){ texdetail=4; } LOG("Initializing sound system..."); #if PLATFORM_LINUX int output = -1; extern bool cmdline(const char *cmd); unsigned char rc = 0; output = OPENAL_OUTPUT_ALSA; // Try alsa first... if (cmdline("forceoss")) // ...but let user override that. output = OPENAL_OUTPUT_OSS; else if (cmdline("nosound")) output = OPENAL_OUTPUT_NOSOUND; OPENAL_SetOutput(output); if ((rc = OPENAL_Init(44100, 32, 0)) == false) { // if we tried ALSA and failed, fall back to OSS. if ( (output == OPENAL_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) { OPENAL_Close(); output = OPENAL_OUTPUT_OSS; OPENAL_SetOutput(output); rc = OPENAL_Init(44100, 32, 0); } } if (rc == false) { OPENAL_Close(); output = OPENAL_OUTPUT_NOSOUND; // we tried! just do silence. OPENAL_SetOutput(output); rc = OPENAL_Init(44100, 32, 0); } #else OPENAL_Init(44100, 32, 0); #endif OPENAL_SetSFXMasterVolume((int)(volume*255)); loadAllSounds(); if(musictoggle) emit_stream_np(stream_menutheme); LoadTexture(":Data:Textures:Cursor.png",&cursortexture,0,1); LoadTexture(":Data:Textures:MapCircle.png",&Mapcircletexture,0,1); LoadTexture(":Data:Textures:MapBox.png",&Mapboxtexture,0,1); LoadTexture(":Data:Textures:MapArrow.png",&Maparrowtexture,0,1); temptexdetail=texdetail; if(texdetail>2)texdetail=2; LoadTexture(":Data:Textures:Lugaru.png",&Mainmenuitems[0],0,0); LoadTexture(":Data:Textures:Newgame.png",&Mainmenuitems[1],0,0); LoadTexture(":Data:Textures:Options.png",&Mainmenuitems[2],0,0); LoadTexture(":Data:Textures:Quit.png",&Mainmenuitems[3],0,0); LoadTexture(":Data:Textures:Eyelid.png",&Mainmenuitems[4],0,1); LoadTexture(":Data:Textures:Resume.png",&Mainmenuitems[5],0,0); LoadTexture(":Data:Textures:Endgame.png",&Mainmenuitems[6],0,0); //LoadTexture(":Data:Textures:Eye.jpg",&Mainmenuitems[5],0,1); //~ LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); // LoadCampaign will take care of that texdetail=temptexdetail; FadeLoadingScreen(95); gameon=0; mainmenu=1; stillloading=0; firstload=0; oldmainmenu=0; newdetail=detail; newscreenwidth=screenwidth; newscreenheight=screenheight; } void Game::LoadScreenTexture() { glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); if(!screentexture) glGenTextures( 1, &screentexture ); glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, screentexture); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0); } void Game::LoadStuff() { static float temptexdetail; static float viewdistdetail; static int i,j; float megascale =1; LOGFUNC; visibleloading=1; loadtime=0; stillloading=1; for(i=0;i HEADER FILES <**/ #include #include #include #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #define Polygon WinPolygon #include #undef Polygon #include "GL/gl.h" #else #include "gamegl.h" // #include "MoreFilesX.h" #endif //#include //#include /**> DATA STRUCTURES <**/ typedef struct TGAImageRec { GLubyte *data; // Image Data (Up To 32 Bits) GLuint bpp; // Image Color Depth In Bits Per Pixel. GLuint sizeX; GLuint sizeY; } TGAImageRec; bool upload_image(const unsigned char* filePath, bool hasalpha); #endif lugaru-0~20110520.1+hge4354.orig/Source/Sounds.def0000644000000000000000000000765711571222446017614 0ustar rootroot/* Copyright (C) 2010 - Lugaru authors This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ DECLARE_SOUND(footstepsn1, "footstepsnow1.ogg") DECLARE_SOUND(footstepsn2, "footstepsnow2.ogg") DECLARE_SOUND(footstepst1, "footstepstone1.ogg") DECLARE_SOUND(footstepst2, "footstepstone2.ogg") DECLARE_SOUND(footstepgr1, "footstepgrass1.ogg") DECLARE_SOUND(footstepgr2, "footstepgrass2.ogg") DECLARE_SOUND(landsound, "land.ogg") DECLARE_SOUND(jumpsound, "jump.ogg") DECLARE_SOUND(hawksound, "hawk.ogg") DECLARE_SOUND(whooshsound, "whoosh.ogg") DECLARE_SOUND(landsound1, "land1.ogg") DECLARE_SOUND(landsound2, "land2.ogg") DECLARE_SOUND(breaksound, "broken.ogg") DECLARE_SOUND(lowwhooshsound, "lowwhoosh.ogg") DECLARE_SOUND(midwhooshsound, "midwhoosh.ogg") DECLARE_SOUND(highwhooshsound, "highwhoosh.ogg") DECLARE_SOUND(movewhooshsound, "movewhoosh.ogg") DECLARE_SOUND(heavyimpactsound, "heavyimpact.ogg") DECLARE_SOUND(whooshhitsound, "whooshhit.ogg") DECLARE_SOUND(thudsound, "thud.ogg") DECLARE_SOUND(alarmsound, "alarm.ogg") DECLARE_SOUND(breaksound2, "break.ogg") DECLARE_SOUND(knifedrawsound, "knifedraw.ogg") DECLARE_SOUND(knifesheathesound, "knifesheathe.ogg") DECLARE_SOUND(fleshstabsound, "fleshstab.ogg") DECLARE_SOUND(fleshstabremovesound, "fleshstabremove.ogg") DECLARE_SOUND(knifeswishsound, "knifeswish.ogg") DECLARE_SOUND(knifeslicesound, "knifeslice.ogg") DECLARE_SOUND(swordslicesound, "swordslice.ogg") DECLARE_SOUND(skidsound, "skid.ogg") DECLARE_SOUND(snowskidsound, "snowskid.ogg") DECLARE_SOUND(bushrustle, "bushrustle.ogg") DECLARE_SOUND(clank1sound, "clank1.ogg") DECLARE_SOUND(clank2sound, "clank2.ogg") DECLARE_SOUND(clank3sound, "clank3.ogg") DECLARE_SOUND(clank4sound, "clank4.ogg") DECLARE_SOUND(consolesuccesssound, "consolesuccess.ogg") DECLARE_SOUND(consolefailsound, "consolefail.ogg") DECLARE_SOUND(metalhitsound, "metalhit.ogg") DECLARE_SOUND(clawslicesound, "clawslice.ogg") DECLARE_SOUND(splattersound, "splatter.ogg") DECLARE_SOUND(growlsound, "growl.ogg") DECLARE_SOUND(growl2sound, "growl2.ogg") DECLARE_SOUND(barksound, "bark.ogg") DECLARE_SOUND(bark2sound, "bark2.ogg") DECLARE_SOUND(bark3sound, "bark3.ogg") DECLARE_SOUND(snarlsound, "snarl.ogg") DECLARE_SOUND(snarl2sound, "snarl2.ogg") DECLARE_SOUND(barkgrowlsound, "barkgrowl.ogg") DECLARE_SOUND(rabbitattacksound, "rabbitattack.ogg") DECLARE_SOUND(rabbitattack2sound, "rabbitattack2.ogg") DECLARE_SOUND(rabbitattack3sound, "rabbitattack3.ogg") DECLARE_SOUND(rabbitattack4sound, "rabbitattack4.ogg") DECLARE_SOUND(rabbitpainsound, "rabbitpain.ogg") DECLARE_SOUND(rabbitpain1sound, "rabbitpain2.ogg") DECLARE_SOUND(rabbitchitter, "rabbitchitter.ogg") DECLARE_SOUND(rabbitchitter2, "rabbitchitter2.ogg") DECLARE_SOUND(swordstaffsound, "swordstaff.ogg") DECLARE_SOUND(staffbodysound, "staffbody.ogg") DECLARE_SOUND(staffheadsound, "staffhead.ogg") DECLARE_SOUND(staffbreaksound, "staffbreak.ogg") DECLARE_SOUND(firestartsound, "firestart.ogg") DECLARE_SOUND(fireendsound, "fireend.ogg") DECLARE_SOUND(stream_firesound, "fire.ogg") DECLARE_SOUND(stream_grasstheme, "music1grass.ogg") DECLARE_SOUND(stream_snowtheme, "music1snow.ogg") DECLARE_SOUND(stream_deserttheme, "music1desert.ogg") DECLARE_SOUND(stream_wind, "wind.ogg") DECLARE_SOUND(stream_desertambient, "desertambient.ogg") DECLARE_SOUND(stream_fighttheme, "music2.ogg") DECLARE_SOUND(stream_menutheme, "music3.ogg") lugaru-0~20110520.1+hge4354.orig/Source/GameDraw.cpp0000644000000000000000000031616711571222446020053 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Game.h" #include "openal_wrapper.h" #include "Input.h" #include "Awards.h" #include using namespace std; extern XYZ viewer; extern int environment; extern float texscale; extern Light light; extern Terrain terrain; //extern Sprites sprites; extern float multiplier; extern float sps; extern float viewdistance; extern float fadestart; extern float screenwidth,screenheight; extern int kTextureSize; extern FRUSTUM frustum; extern Light light; extern Objects objects; extern int detail; extern float usermousesensitivity; extern bool osx; extern float camerashake; extern int slomo; extern float slomodelay; extern bool ismotionblur; extern float woozy; extern float blackout; extern bool damageeffects; extern float volume; extern bool texttoggle; extern float blurness; extern float targetblurness; extern float playerdist; extern bool cellophane; extern bool freeze; extern float flashamount,flashr,flashg,flashb; extern int flashdelay; extern int netstate; extern float motionbluramount; extern bool isclient; extern bool alwaysblur; extern int test; extern bool tilt2weird; extern bool tiltweird; extern bool midweird; extern bool proportionweird; extern bool vertexweird[6]; extern bool velocityblur; extern bool debugmode; extern int mainmenu; extern int oldmainmenu; extern int bloodtoggle; extern int difficulty; extern bool decals; // MODIFIED GWC //extern int texdetail; extern float texdetail; extern bool musictoggle; extern int tutoriallevel; extern float smoketex; extern float tutorialstagetime; extern float tutorialmaxtime; extern int tutorialstage; extern bool againbonus; extern float damagedealt; extern bool invertmouse; extern int numhotspots; extern int killhotspot; extern XYZ hotspot[40]; extern int hotspottype[40]; extern float hotspotsize[40]; extern char hotspottext[40][256]; extern int currenthotspot;; extern bool campaign; extern bool winfreeze; extern float menupulse; extern bool gamestart; extern bool gamestarted; extern bool showdamagebar; enum drawmodes { normalmode, motionblurmode, radialzoommode, realmotionblurmode, doublevisionmode, glowmode, }; void Game::flash() { // shouldn't be that way, these should be attributes and Person class should not change rendering. flashr=1; flashg=0; flashb=0; flashamount=1; flashdelay=1; } /*********************> DrawGLScene() <*****/ int Game::DrawGLScene(StereoSide side) { static float texcoordwidth,texcoordheight; static float texviewwidth, texviewheight; static int i,j,k,l; static GLubyte color; static XYZ checkpoint; static float tempmult; float tutorialopac; static char string[256]=""; static char string2[256]=""; static char string3[256]=""; if ( stereomode == stereoAnaglyph ) { switch(side) { case stereoLeft: glColorMask( 0.0, 1.0, 1.0, 1.0 ); break; case stereoRight: glColorMask( 1.0, 0.0, 0.0, 1.0 ); break; } } else { glColorMask( 1.0, 1.0, 1.0, 1.0 ); if ( stereomode == stereoHorizontalInterlaced || stereomode == stereoVerticalInterlaced ) { glStencilFunc(side == stereoLeft ? GL_NOTEQUAL : GL_EQUAL, 0x01, 0x01); } } if(freeze||winfreeze||(mainmenu&&gameon)||(!gameon&&gamestarted)){ tempmult=multiplier; multiplier=0; } if(!mainmenu){ if(editorenabled){ numboundaries=mapradius*2; if(numboundaries>360)numboundaries=360; for(i=0;i200)&&velocityblur&&!cameramode){ drawmode=motionblurmode; motionbluramount=200/(findLengthfast(&player[0].velocity)); changed=1; } if(player[0].damage-player[0].superpermanentdamage>(player[0].damagetolerance-player[0].superpermanentdamage)*1/2&&damageeffects&&!cameramode){ drawmode=doublevisionmode; changed=1; } } if(slomo&&!loading){ if(ismotionblur) drawmode=motionblurmode; motionbluramount=.2; slomodelay-=multiplier; if(slomodelay<0)slomo=0; camerashake=0; changed=1; } if((!changed&&!slomo)||loading){ drawmode=normalmode; if(ismotionblur&&(/*fps>100||*/alwaysblur)){ if(olddrawmode!=realmotionblurmode)change=1; else change=0; drawmode=realmotionblurmode; } else if(olddrawmode==realmotionblurmode)change=2; else change=0; } if(freeze||winfreeze||(mainmenu&&gameon)||(!gameon&&gamestarted))drawmode=normalmode; if((freeze||winfreeze)&&ismotionblur&&!mainmenu)drawmode=radialzoommode; if(winfreeze||mainmenu)drawmode=normalmode; #if PLATFORM_MACOSX if(drawmode==glowmode){ RGBColor color2; color2.red=0; color2.green=0; color2.blue=0; DSpContext_FadeGamma(NULL,200,&color2); } #endif if(drawtoggle!=2)drawtoggle=1-drawtoggle; if(!texcoordwidth){ texviewwidth=kTextureSize; if(texviewwidth>screenwidth)texviewwidth=screenwidth; texviewheight=kTextureSize; if(texviewheight>screenheight)texviewheight=screenheight; texcoordwidth=screenwidth/kTextureSize; texcoordheight=screenheight/kTextureSize; if(texcoordwidth>1)texcoordwidth=1; if(texcoordheight>1)texcoordheight=1; } glDrawBuffer(GL_BACK); glReadBuffer(GL_BACK); if(abs(blurness-targetblurness)2){ blurness=targetblurness; targetblurness=(float)(abs(Random()%100))/40; } if(blurness=typesleeping)&&player[k].playerdetail) if(frustum.SphereInFrustum(player[k].coords.x,player[k].coords.y,player[k].coords.z,player[k].scale*5)&&player[k].occluded<25) for(i=0;i=1)glDisable(GL_BLEND); if(distance>=.5){ checkpoint=DoRotation(player[k].skeleton.joints[abs(Random()%player[k].skeleton.num_joints)].position,0,player[k].rotation,0)*player[k].scale+player[k].coords; checkpoint.y+=1; if(!player[k].occluded==0)i=checkcollide(viewer,checkpoint,player[k].lastoccluded); if(i==-1||player[k].occluded==0)i=checkcollide(viewer,checkpoint); if(i!=-1){ player[k].occluded+=1; player[k].lastoccluded=i; } else player[k].occluded=0; if(player[k].occluded<25)player[k].DrawSkeleton(); } } } } if(!cameramode&&musictype==stream_fighttheme)playerdist=findDistancefastflat(&player[0].coords,&viewer); else playerdist=-100; glPushMatrix(); glCullFace(GL_BACK); glEnable(GL_TEXTURE_2D); objects.Draw(); glPopMatrix(); glPushMatrix(); if(frustum.SphereInFrustum(realhawkcoords.x+hawk.boundingspherecenter.x,realhawkcoords.y+hawk.boundingspherecenter.y,realhawkcoords.z+hawk.boundingspherecenter.z,2)){ glAlphaFunc(GL_GREATER, 0.0001f); glDepthMask(1); glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glEnable(GL_BLEND); glTranslatef(hawkcoords.x,hawkcoords.y,hawkcoords.z); glRotatef(hawkrotation,0,1,0); glTranslatef(25,0,0); distance=findDistancefast(&viewer,&realhawkcoords)*1.2; glColor4f(light.color[0],light.color[1],light.color[2],(viewdistance*viewdistance-(distance-(viewdistance*viewdistance*fadestart))*(1/(1-fadestart)))/viewdistance/viewdistance); if((viewdistance*viewdistance-(distance-(viewdistance*viewdistance*fadestart))*(1/(1-fadestart)))/viewdistance/viewdistance>1)glColor4f(light.color[0],light.color[1],light.color[2],1); if((viewdistance*viewdistance-(distance-(viewdistance*viewdistance*fadestart))*(1/(1-fadestart)))/viewdistance/viewdistance>0) hawk.drawdifftex(hawktexture); } glPopMatrix(); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); glDepthMask(1); for(k=0;k=1)glDisable(GL_BLEND); if(distance>=.5){ checkpoint=DoRotation(player[k].skeleton.joints[abs(Random()%player[k].skeleton.num_joints)].position,0,player[k].rotation,0)*player[k].scale+player[k].coords; checkpoint.y+=1; if(!player[k].occluded==0)i=checkcollide(viewer,checkpoint,player[k].lastoccluded); if(i==-1||player[k].occluded==0)i=checkcollide(viewer,checkpoint); if(i!=-1){ player[k].occluded+=1; player[k].lastoccluded=i; } else player[k].occluded=0; if(player[k].occluded<25)player[k].DrawSkeleton(); } } } glPushMatrix(); glEnable(GL_TEXTURE_2D); weapons.Draw(); glPopMatrix(); glCullFace(GL_BACK); glDisable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); Sprite::Draw(); if(editorenabled){ glEnable(GL_BLEND); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDisable(GL_COLOR_MATERIAL); glColor4f(1,1,0,1); for(k=0;k1){ glBegin(GL_LINE_LOOP); for(i=0;i1){ glColor4f(0,1,0,1); for(k=0;k0&&bonustime<1&&!winfreeze&&indialogue==-1/*bonustime<4*/){ const char *bonus_name; if (bonus < bonus_count) bonus_name = bonus_names[bonus]; else bonus_name = "Excellent!"; // When does this happen? glColor4f(0,0,0,1-bonustime); text.glPrintOutline(1024/2-10*strlen(bonus_name)-4,768/16-4+768*4/5,bonus_name,1,2.5,1024,768); glColor4f(1,0,0,1-bonustime); text.glPrint(1024/2-10*strlen(bonus_name),768/16+768*4/5,bonus_name,1,2,1024,768); sprintf (string, "%d",(int)bonusvalue); glColor4f(0,0,0,1-bonustime); text.glPrintOutline(1024/2-10*strlen(string)-4,768/16-4-20+768*4/5,string,1,2.5*.8,1024,768); glColor4f(1,0,0,1-bonustime); text.glPrint(1024/2-10*strlen(string),768/16-20+768*4/5,string,1,2*.8,1024,768); glColor4f(.5,.5,.5,1); } if(tutoriallevel==1){ tutorialopac=tutorialmaxtime-tutorialstagetime; if(tutorialopac>1)tutorialopac=1; if(tutorialopac<0)tutorialopac=0; sprintf (string, " "); sprintf (string2, " "); sprintf (string3, " "); if(tutorialstage==0){ sprintf (string, " "); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==1){ sprintf (string, "Welcome to the Lugaru training level!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==2){ sprintf (string, "BASIC MOVEMENT:"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==3){ sprintf (string, "You can move the mouse to rotate the camera."); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==4){ sprintf (string, "Try using the %s, %s, %s and %s keys to move around.",Input::keyToChar(forwardkey),Input::keyToChar(leftkey),Input::keyToChar(backkey),Input::keyToChar(rightkey)); sprintf (string2, "All movement is relative to the camera."); sprintf (string3, " "); } if(tutorialstage==5){ sprintf (string, "Please press %s to jump.",Input::keyToChar(jumpkey)); sprintf (string2, "You can hold it longer to jump higher."); sprintf (string3, " "); } if(tutorialstage==6){ sprintf (string, "You can press %s to crouch.",Input::keyToChar(crouchkey)); sprintf (string2, "You can jump higher from a crouching position."); sprintf (string3, " "); } if(tutorialstage==7){ sprintf (string, "While running, you can press %s to roll.",Input::keyToChar(crouchkey)); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==8){ sprintf (string, "While crouching, you can sneak around silently"); sprintf (string2, "using the movement keys."); sprintf (string3, " "); } if(tutorialstage==9){ sprintf (string, "Release the crouch key while sneaking and hold the movement keys"); sprintf (string2, "to run animal-style."); sprintf (string3, " "); } if(tutorialstage==10){ sprintf (string, "ADVANCED MOVEMENT:"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==11){ sprintf (string, "When you jump at a wall, you can hold %s again",Input::keyToChar(jumpkey)); sprintf (string2, "during impact to perform a walljump."); sprintf (string3, "Be sure to use the movement keys to press against the wall"); } if(tutorialstage==12){ sprintf (string, "While in the air, you can press crouch to flip.",Input::keyToChar(jumpkey)); sprintf (string2, "Walljumps and flips confuse enemies and give you more control."); sprintf (string3, " "); } if(tutorialstage==13){ sprintf (string, "BASIC COMBAT:"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==14){ sprintf (string, "There is now an imaginary enemy"); sprintf (string2, "in the middle of the training area."); sprintf (string3, " "); } if(tutorialstage==15){ if(attackkey==MOUSEBUTTON1)sprintf (string, "Click to attack when you are near an enemy."); else sprintf (string, "Press %s to attack when you are near an enemy.",Input::keyToChar(attackkey)); sprintf (string2, "You can punch by standing still near an enemy and attacking."); sprintf (string3, " "); } if(tutorialstage==16){ sprintf (string, "If you are close, you will perform a weak punch."); sprintf (string2, "The weak punch is excellent for starting attack combinations."); sprintf (string3, " "); } if(tutorialstage==17){ sprintf (string, "Attacking while running results in a spin kick."); sprintf (string2, "This is one of your most powerful ground attacks."); sprintf (string3, " "); } if(tutorialstage==18){ sprintf (string, "Sweep the enemy's legs out by attacking while crouched."); sprintf (string2, "This is a very fast attack, and easy to follow up."); sprintf (string3, " "); } if(tutorialstage==19){ sprintf (string, "When an enemy is on the ground, you can deal some extra"); sprintf (string2, "damage by running up and drop-kicking him."); sprintf (string3, "(Try knocking them down with a sweep first)"); } if(tutorialstage==20){ sprintf (string, "Your most powerful individual attack is the rabbit kick."); if(attackkey==MOUSEBUTTON1)sprintf (string2, "Run at the enemy while holding the mouse button, and press"); else sprintf (string2, "Run at the enemy while holding %s, and press", Input::keyToChar(attackkey)); sprintf (string3, "the jump key (%s) to attack.",Input::keyToChar(jumpkey)); } if(tutorialstage==21){ sprintf (string, "This attack is devastating if timed correctly."); sprintf (string2, "Even if timed incorrectly, it will knock the enemy over."); if(againbonus)sprintf (string3, "Try rabbit-kicking the imaginary enemy again."); else sprintf (string3, "Try rabbit-kicking the imaginary enemy."); } if(tutorialstage==22){ sprintf (string, "If you sneak behind an enemy unnoticed, you can kill"); sprintf (string2, "him instantly. Move close behind this enemy"); sprintf (string3, "and attack."); } if(tutorialstage==23){ sprintf (string, "Another important attack is the wall kick. When an enemy"); sprintf (string2, "is near a wall, perform a walljump nearby and hold"); sprintf (string3, "the attack key during impact with the wall."); } if(tutorialstage==24){ sprintf (string, "You can tackle enemies by running at them animal-style"); if(attackkey==MOUSEBUTTON1)sprintf (string2, "and pressing jump (%s) or attack(mouse button).",Input::keyToChar(jumpkey)); else sprintf (string2, "and pressing jump (%s) or attack(%s).",Input::keyToChar(jumpkey),Input::keyToChar(attackkey)); sprintf (string3, "This is especially useful when they are running away."); } if(tutorialstage==25){ sprintf (string, "Dodge by pressing back and attack. Dodging is essential"); sprintf (string2, "against enemies with swords or other long weapons."); sprintf (string3, " "); } if(tutorialstage==26){ sprintf (string, "REVERSALS AND COUNTER-REVERSALS"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==27){ sprintf (string, "The enemy can now reverse your attacks."); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==28){ sprintf (string, "If you attack, you will notice that the enemy now sometimes"); sprintf (string2, "catches your attack and uses it against you. Hold"); sprintf (string3, "crouch (%s) after attacking to escape from reversals.",Input::keyToChar(crouchkey)); } if(tutorialstage==29){ sprintf (string, "Try escaping from two more reversals in a row."); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==30){ sprintf (string, "Good!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==31){ sprintf (string, "To reverse an attack, you must tap crouch (%s) during the",Input::keyToChar(crouchkey)); sprintf (string2, "enemy's attack. You must also be close to the enemy;"); sprintf (string3, "this is especially important against armed opponents."); } if(tutorialstage==32){ sprintf (string, "The enemy can attack in %d seconds.", (int)(tutorialmaxtime-tutorialstagetime)); sprintf (string2, "This imaginary opponents attacks will be highlighted"); sprintf (string3, "to make this easier."); } if(tutorialstage==33){ sprintf (string, "Reverse three enemy attacks!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==34){ sprintf (string, "Reverse two more enemy attacks!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==35){ sprintf (string, "Reverse one more enemy attack!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==36){ sprintf (string, "Excellent!"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==37){ sprintf (string, "Now spar with the enemy for %d more seconds.", (int)(tutorialmaxtime-tutorialstagetime)); sprintf (string2, "Damage dealt: %d",(int)damagedealt); sprintf (string3, "Damage taken: %d.",(int)damagetaken); } if(tutorialstage==38){ sprintf (string, "WEAPONS:"); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==39){ sprintf (string, "There is now an imaginary knife"); sprintf (string2, "in the center of the training area."); sprintf (string3, " "); } if(tutorialstage==40){ sprintf (string, "Stand, roll or handspring over the knife"); sprintf (string2, "while pressing %s to pick it up.",Input::keyToChar(throwkey)); sprintf (string3, "You can crouch and press the same key to drop it again."); } if(tutorialstage==41){ sprintf (string, "You can equip and unequip weapons using the %s key.",Input::keyToChar(drawkey)); sprintf (string2, "Sometimes it is best to keep them unequipped to"); sprintf (string3, "prevent enemies from taking them. "); } if(tutorialstage==42){ sprintf (string, "The knife is the smallest weapon and the least encumbering."); sprintf (string2, "You can equip or unequip it while standing, crouching,"); sprintf (string3, "running or flipping."); } if(tutorialstage==43){ sprintf (string, "You perform weapon attacks the same way as unarmed attacks,"); sprintf (string2, "but sharp weapons cause permanent damage, instead of the"); sprintf (string3, "temporary trauma from blunt weapons, fists and feet."); } if(tutorialstage==44){ sprintf (string, "The enemy now has your knife!"); sprintf (string2, "Please reverse two of his knife attacks."); sprintf (string3, " "); } if(tutorialstage==45){ sprintf (string, "Please reverse one more of his knife attacks."); sprintf (string2, " "); sprintf (string3, " "); } if(tutorialstage==46){ sprintf (string, "Now he has a sword!"); sprintf (string2, "The sword has longer reach than your arms, so you"); sprintf (string3, "must move close to reverse the sword slash."); } if(tutorialstage==47){ sprintf (string, "Long weapons like the sword and staff are also useful for defense;"); sprintf (string2, "you can parry enemy weapon attacks by pressing the attack key"); sprintf (string3, "at the right time. Please try parrying the enemy's attacks!"); } if(tutorialstage==48){ sprintf (string, "The staff is like the sword, but has two main attacks."); sprintf (string2, "The standing smash is fast and effective, and the running"); sprintf (string3, "spin smash is slower and more powerful."); } if(tutorialstage==49){ sprintf (string, "When facing an enemy, you can throw the knife with %s.",Input::keyToChar(throwkey)); sprintf (string2, "It is possible to throw the knife while flipping,"); sprintf (string3, "but it is very inaccurate."); } if(tutorialstage==50){ sprintf (string, "You now know everything you can learn from training."); sprintf (string2, "Everything else you must learn from experience!"); sprintf (string3, " "); } if(tutorialstage==51){ sprintf (string, "Walk out of the training area to return to the main menu."); sprintf (string2, " "); sprintf (string3, " "); } glColor4f(0,0,0,tutorialopac); text.glPrintOutline(screenwidth/2-7.6*strlen(string)*screenwidth/1024-4,screenheight/16-4+screenheight*4/5,string,1,1.5*1.25*screenwidth/1024,screenwidth,screenheight); text.glPrintOutline(screenwidth/2-7.6*strlen(string2)*screenwidth/1024-4,screenheight/16-4+screenheight*4/5-20*screenwidth/1024,string2,1,1.5*1.25*screenwidth/1024,screenwidth,screenheight); text.glPrintOutline(screenwidth/2-7.6*strlen(string3)*screenwidth/1024-4,screenheight/16-4+screenheight*4/5-40*screenwidth/1024,string3,1,1.5*1.25*screenwidth/1024,screenwidth,screenheight); glColor4f(1,1,1,tutorialopac); text.glPrint(screenwidth/2-7.6*strlen(string)*screenwidth/1024,screenheight/16+screenheight*4/5,string,1,1.5*screenwidth/1024,screenwidth,screenheight); text.glPrint(screenwidth/2-7.6*strlen(string2)*screenwidth/1024,screenheight/16+screenheight*4/5-20*screenwidth/1024,string2,1,1.5*screenwidth/1024,screenwidth,screenheight); text.glPrint(screenwidth/2-7.6*strlen(string3)*screenwidth/1024,screenheight/16+screenheight*4/5-40*screenwidth/1024,string3,1,1.5*screenwidth/1024,screenwidth,screenheight); sprintf (string, "Press 'tab' to skip to the next item.",Input::keyToChar(jumpkey)); sprintf (string2, "Press escape at any time to"); sprintf (string3, "pause or exit the tutorial."); glColor4f(0,0,0,1); text.glPrintOutline(screenwidth/2-7.6*strlen(string)*screenwidth/1024*.8-4,0-4+screenheight*1/10,string,1,1.5*1.25*screenwidth/1024*.8,screenwidth,screenheight); text.glPrintOutline(screenwidth/2-7.6*strlen(string2)*screenwidth/1024*.8-4,0-4+screenheight*1/10-20*.8*screenwidth/1024,string2,1,1.5*1.25*screenwidth/1024*.8,screenwidth,screenheight); text.glPrintOutline(screenwidth/2-7.6*strlen(string3)*screenwidth/1024*.8-4,0-4+screenheight*1/10-40*.8*screenwidth/1024,string3,1,1.5*1.25*screenwidth/1024*.8,screenwidth,screenheight); glColor4f(0.5,0.5,0.5,1); text.glPrint(screenwidth/2-7.6*strlen(string)*screenwidth/1024*.8,0+screenheight*1/10,string,1,1.5*screenwidth/1024*.8,screenwidth,screenheight); text.glPrint(screenwidth/2-7.6*strlen(string2)*screenwidth/1024*.8,0+screenheight*1/10-20*.8*screenwidth/1024,string2,1,1.5*screenwidth/1024*.8,screenwidth,screenheight); text.glPrint(screenwidth/2-7.6*strlen(string3)*screenwidth/1024*.8,0+screenheight*1/10-40*.8*screenwidth/1024,string3,1,1.5*screenwidth/1024*.8,screenwidth,screenheight); } //Hot spots if(numhotspots&&(bonustime>=1||bonus<=0||bonustime<0)&&!tutoriallevel){ int closest=-1; float closestdist=-1; float distance=0; closest=currenthotspot; for(i=0;i=0)||(hotspottype[i]<=40&&hotspottype[i]>=20))){ closestdist=distance; closest=i; } } } if(closest!=-1) currenthotspot=closest; if(currenthotspot!=-1){ if(hotspottype[closest]<=10){ if(findDistancefast(&player[0].coords,&hotspot[closest])1)tutorialopac=1; if(tutorialopac<0)tutorialopac=0; sprintf (string, "%s", hotspottext[closest]); int lastline = 0; int line = 0; bool done = false; i=0; while(!done){ if(string[i]=='\n'||string[i]>'z'||string[i]<' '||string[i]=='\0'){ glColor4f(0,0,0,tutorialopac); text.glPrintOutline(screenwidth/2-7.6*(i-lastline)*screenwidth/1024-4,screenheight/16-4+screenheight*4/5-20*screenwidth/1024*line,string,1,1.5*1.25*screenwidth/1024,screenwidth,screenheight,lastline,i); glColor4f(1,1,1,tutorialopac); text.glPrint(screenwidth/2-7.6*(i-lastline)*screenwidth/1024,screenheight/16+screenheight*4/5-20*screenwidth/1024*line,string,1,1.5*screenwidth/1024,screenwidth,screenheight,lastline,i); lastline=i+1; line++; if(string[i]=='\0')done=1; } if(i>=255)done=1; i++; } } else if (hotspottype[closest]>=20&&dialoguegonethrough[hotspottype[closest]-20]==0){ whichdialogue=hotspottype[closest]-20; for(j=0;j'z'||string[i]<' '||string[i]=='\0'){ if(dialogueboxcolor[whichdialogue][indialogue][0]+dialogueboxcolor[whichdialogue][indialogue][1]+dialogueboxcolor[whichdialogue][indialogue][2]<1.5){ glColor4f(0,0,0,tutorialopac); text.glPrintOutline(startx/*-7.6*(i-lastline)*screenwidth/1024*/-4,starty-4-20*screenwidth/1024*line,string,1,1.5*1.25*screenwidth/1024,screenwidth,screenheight,lastline,i); glColor4f(1,1,1,tutorialopac); text.glPrint(startx/*-7.6*(i-lastline)*screenwidth/1024*/,starty-20*screenwidth/1024*line,string,1,1.5*screenwidth/1024,screenwidth,screenheight,lastline,i); } else { glColor4f(0,0,0,tutorialopac); text.glPrint(startx/*-7.6*(i-lastline)*screenwidth/1024*/,starty-20*screenwidth/1024*line,string,1,1.5*screenwidth/1024,screenwidth,screenheight,lastline,i); } lastline=i+1; line++; if(string[i]=='\0')done=1; } if(i>=255)done=1; i++; } } if(!tutoriallevel&&!winfreeze&&indialogue==-1&&!mainmenu){ if(campaign){ if(scoreadded) sprintf (string, "Score: %d", (int)accountactive->getCampaignScore()); else sprintf (string, "Score: %d", (int)accountactive->getCampaignScore()+(int)bonustotal); } if(!campaign)sprintf (string, "Score: %d", (int)bonustotal); glColor4f(0,0,0,1); text.glPrintOutline(1024/40-4,768/16-4+768*14/16,string,1,1.5*1.25,1024,768); glColor4f(1,0,0,1); text.glPrint(1024/40,768/16+768*14/16,string,1,1.5,1024,768); if(showdamagebar) { glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(15,screenheight*17.5/20,0); glScalef(screenwidth/3+20,screenheight/20,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(0.0,0.4,0.0,0.7); float bar=((float)player[0].damage)/player[0].damagetolerance; glBegin(GL_QUADS); glVertex3f((bar<1?bar:1),0,0.0f); glVertex3f(1,0,0.0f); glVertex3f(1,1,0.0f); glVertex3f((bar<1?bar:1),1,0.0f); glEnd(); glColor4f(0.1,0.0,0.0,1); bar = ((float)player[0].bloodloss)/player[0].damagetolerance; glBegin(GL_QUADS); glVertex3f(0,0,0.0f); glVertex3f((bar<1?bar:1),0,0.0f); glVertex3f((bar<1?bar:1),1,0.0f); glVertex3f(0,1,0.0f); glEnd(); glColor4f(0.4,0.0,0.0,0.7); bar = ((float)player[0].damage)/player[0].damagetolerance; glBegin(GL_QUADS); glVertex3f(0,0,0.0f); glVertex3f((bar<1?bar:1),0,0.0f); glVertex3f((bar<1?bar:1),1,0.0f); glVertex3f(0,1,0.0f); glEnd(); glColor4f(0.4,0.0,0.0,0.7); bar = ((float)player[0].permanentdamage)/player[0].damagetolerance; glBegin(GL_QUADS); glVertex3f(0,0,0.0f); glVertex3f((bar<1?bar:1),0,0.0f); glVertex3f((bar<1?bar:1),1,0.0f); glVertex3f(0,1,0.0f); glEnd(); glColor4f(0.4,0.0,0.0,0.7); bar = ((float)player[0].superpermanentdamage)/player[0].damagetolerance; glBegin(GL_QUADS); glVertex3f(0,0,0.0f); glVertex3f((bar<1?bar:1),0,0.0f); glVertex3f((bar<1?bar:1),1,0.0f); glVertex3f(0,1,0.0f); glEnd(); glColor4f(0.0,0.0,0.0,0.7); glLineWidth(2.0); glBegin(GL_LINE_STRIP); glVertex3f(0,0,0.0f); glVertex3f(1,0,0.0f); glVertex3f(1,1,0.0f); glVertex3f(0,1,0.0f); glVertex3f(0,0,0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); glEnable(GL_TEXTURE_2D); // writing the numbers : sprintf (string, "Damages : %d/%d (%d)",(int)(player[0].damage),(int)(player[0].damagetolerance),(int)(player[0].bloodloss)); glColor4f(0,0,0,1); text.glPrintOutline(1024/40-4,768/16-4+768*14/16-40,string,1,1.5*1.25,1024,768); glColor4f(1,0,0,1); text.glPrint(1024/40,768/16+768*14/16-40,string,1,1.5,1024,768); } } glColor4f(.5,.5,.5,1); if((texttoggle||editorenabled)&&debugmode&&!mainmenu){ sprintf (string, "The framespersecond is %d.",(int)(fps)); text.glPrint(10,30,string,0,.8,1024,768); sprintf (string, "Name: %s", registrationname); text.glPrint(10,260,string,0,.8,1024,768); if(editorenabled) sprintf (string, "Map editor enabled."); else sprintf (string, "Map editor disabled."); text.glPrint(10,60,string,0,.8,1024,768); if(editorenabled){ sprintf (string, "Object size: %f",editorsize); text.glPrint(10,75,string,0,.8,1024,768); if(editorrotation>=0)sprintf (string, "Object rotation: %f",editorrotation); else sprintf (string, "Object rotation: Random"); text.glPrint(10,90,string,0,.8,1024,768); if(editorrotation2>=0)sprintf (string, "Object rotation2: %f",editorrotation2); else sprintf (string, "Object rotation2: Random"); text.glPrint(10,105,string,0,.8,1024,768); sprintf (string, "Object type: %d",editortype); text.glPrint(10,120,string,0,.8,1024,768); switch(editortype) { case boxtype: sprintf (string, "(box)"); break; case treetrunktype: sprintf (string, "(tree)"); break; case walltype: sprintf (string, "(wall)"); break; case weirdtype: sprintf (string, "(weird)"); break; case spiketype: sprintf (string, "(spike)"); break; case rocktype: sprintf (string, "(rock)"); break; case bushtype: sprintf (string, "(bush)"); break; case tunneltype: sprintf (string, "(tunnel)"); break; case chimneytype: sprintf (string, "(chimney)"); break; case platformtype: sprintf (string, "(platform)"); break; case cooltype: sprintf (string, "(cool)"); break; case firetype: sprintf (string, "(fire)"); break; } text.glPrint(130,120,string,0,.8,1024,768); sprintf (string, "Numplayers: %d",numplayers); text.glPrint(10,155,string,0,.8,1024,768); sprintf (string, "Player %d: numwaypoints: %d",numplayers,player[numplayers-1].numwaypoints); text.glPrint(10,140,string,0,.8,1024,768); } sprintf (string, "Difficulty: %d",difficulty); text.glPrint(10,240,string,0,.8,1024,768); } } if(drawmode==glowmode){ glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(0,0,0,.5); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } if((((blackout&&damageeffects)||(player[0].bloodloss>0&&damageeffects&&player[0].blooddimamount>0)||player[0].dead)&&!cameramode)||console){ glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); if(player[0].dead)blackout+=multiplier*3; if(player[0].dead==1)blackout=.4f; if(player[0].dead==2&&blackout>.6)blackout=.6; glColor4f(0,0,0,blackout); if(!player[0].dead){ if((player[0].bloodloss/player[0].damagetolerance*(sin(woozy)/4+.5))*.3<.3){ glColor4f(0,0,0,player[0].blooddimamount*player[0].bloodloss/player[0].damagetolerance*(sin(woozy)/4+.5)*.3); blackout=player[0].blooddimamount*player[0].bloodloss/player[0].damagetolerance*(sin(woozy)/4+.5)*.3; } else { glColor4f(0,0,0,player[0].blooddimamount*.3); blackout=player[0].blooddimamount*.3; } } if(console)glColor4f(.7,0,0,.2); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } if(flashamount>0&&damageeffects) { if(flashamount>1)flashamount=1; if(flashdelay<=0)flashamount-=multiplier; flashdelay--; if(flashamount<0)flashamount=0; glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(flashr,flashg,flashb,flashamount); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } if(!console) { displaytime[0]=0; glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); if(chatting){ sprintf (string, " ]"); text.glPrint(10,30+screenheight-330,string,0,1,screenwidth,screenheight); if(displayblink){ sprintf (string, "_"); text.glPrint(30+(float)(displayselected)*10,30+(screenheight-330),string,0,1,screenwidth,screenheight); } } for(i=0;i<15;i++) { if((i!=0||chatting)&&displaytime[i]<4) for(j=0;jmaxdistance){ //~ whichclosest=i; maxdistance=tempdist; } } for(i=0;imaxdistance){ //~ whichclosest=i; maxdistance=tempdist; } } } radius=fast_sqrt(maxdistance); radius=110; glScalef(.25/radius*256*terrain.scale*.4,.25/radius*256*terrain.scale*.4,1); glPushMatrix(); glScalef(1/(1/radius*256*terrain.scale*.4),1/(1/radius*256*terrain.scale*.4),1); glPopMatrix(); glRotatef(player[0].lookrotation*-1+180,0,0,1); glTranslatef(-(center.x/terrain.scale/256*-2+1),(center.z/terrain.scale/256*-2+1),0); for(i=0;itypesleeping)glColor4f(0,0,0,opac*(1-distcheck/mapviewdist)); else if(player[i].dead)glColor4f(.3,.3,.3,opac*(1-distcheck/mapviewdist)); else if(player[i].aitype==attacktypecutoff)glColor4f(1,0,0,opac*(1-distcheck/mapviewdist)); else if(player[i].aitype==passivetype)glColor4f(0,1,0,opac*(1-distcheck/mapviewdist)); else glColor4f(1,1,0,1); glTranslatef(player[i].coords.x/terrain.scale/256*-2+1,player[i].coords.z/terrain.scale/256*2-1,0); glRotatef(player[i].rotation+180,0,0,1); glScalef(.005,.005,.005); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); } } glPopMatrix(); glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } if(loading&&!stealthloading&&(!campaign||player[0].dead)){ glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(0,0,0,.7); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); //logo glDisable(GL_DEPTH_TEST); glColor3f (1.0, 1.0, 1.0); // no coloring glEnable(GL_TEXTURE_2D); //Minimap if(loading!=4){ glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); sprintf (string, "Loading..."); text.glPrint(1024/2-90,768/2,string,1,2,1024,768); } loading=2; //if(ismotionblur)drawmode=motionblurmode; drawmode=normalmode; } if(winfreeze&&!campaign){ glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(0,0,0,.4); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); //logo glDisable(GL_DEPTH_TEST); glColor3f (1.0, 1.0, 1.0); // no coloring glEnable(GL_TEXTURE_2D); //Win Screen Won Victory glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); sprintf (string, "Level Cleared!"); text.glPrintOutlined(1024/2-strlen(string)*10,768*7/8,string,1,2,1024,768); sprintf (string, "Score: %d",(int)(bonustotal-startbonustotal)); text.glPrintOutlined(1024/30,768*6/8,string,1,2,1024,768); if(campaign) sprintf (string, "Press Escape or Space to continue"); else sprintf (string, "Press Escape to return to menu or Space to continue"); text.glPrintOutlined(640/2-strlen(string)*5,480*1/16,string,1,1,640,480); char temp[255]; for(i=0;i<255;i++)string[i]='\0'; sprintf (temp, "Time: %d:",(int)(((int)leveltime-(int)(leveltime)%60)/60)); strcat(string,temp); if((int)(leveltime)%60<10)strcat(string,"0"); sprintf (temp, "%d",(int)(leveltime)%60); strcat(string,temp); text.glPrintOutlined(1024/30,768*6/8-40,string,1,2,1024,768); //Awards int awards[award_count]; int numawards = award_awards(awards); for (i = 0; i < numawards && i < 6; i++) text.glPrintOutlined(1024/30,768*6/8-90-40*i,award_names[awards[i]],1,2,1024,768); } if(drawmode!=normalmode){ glEnable(GL_TEXTURE_2D); glFinish(); if(!drawtoggle||drawmode!=realmotionblurmode||(drawtoggle==2||change==1)){ if(screentexture){ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); GLfloat subtractColor[4] = { 0.5, 0.5, 0.5, 0.0 }; glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, subtractColor); //glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_SUBTRACT); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2.0f); glBindTexture( GL_TEXTURE_2D, screentexture); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texviewwidth, texviewheight); } } if((drawtoggle||change==1)&&drawmode==realmotionblurmode){ if(screentexture2){ glBindTexture( GL_TEXTURE_2D, screentexture2); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texviewwidth, texviewheight); } if(!screentexture2){ glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); glGenTextures( 1, &screentexture2 ); glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, screentexture2); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0); } } //glFlush(); } glClear(GL_DEPTH_BUFFER_BIT); ReSizeGLScene(90,.1f); glViewport(0,0,screenwidth,screenheight); if(drawmode!=normalmode){ glDisable(GL_DEPTH_TEST); if(drawmode==motionblurmode){ glDrawBuffer(GL_FRONT); glReadBuffer(GL_BACK); } glColor3f (1.0, 1.0, 1.0); // no coloring glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, screentexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef((float)screenwidth/2,(float)screenheight/2,1); glTranslatef(1,1,0); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); if(drawmode==motionblurmode){ if(motionbluramount<.2)motionbluramount=.2; //glColor4f(1,1,1,fast_sqrt(multiplier)*2.9*motionbluramount); glColor4f(1,1,1,motionbluramount); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); } if(drawmode==realmotionblurmode){ glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glBindTexture( GL_TEXTURE_2D, screentexture); glColor4f(1,1,1,.5); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glBindTexture( GL_TEXTURE_2D, screentexture2); glColor4f(1,1,1,.5); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); } if(drawmode==doublevisionmode){ static float crosseyedness; crosseyedness=abs(player[0].damage-player[0].superpermanentdamage-(player[0].damagetolerance-player[0].superpermanentdamage)*1/2)/30; if(crosseyedness>1)crosseyedness=1; if(crosseyedness<0)crosseyedness=0; glColor4f(1,1,1,1); glDisable(GL_BLEND); glPushMatrix(); glScalef(1,1,1); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); if(crosseyedness){ glColor4f(1,1,1,.5); glEnable(GL_BLEND); glPushMatrix(); glTranslatef(.015*crosseyedness,0,0); glScalef(1,1,1); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); } } if(drawmode==glowmode){ glColor4f(.5,.5,.5,.5); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glPushMatrix(); glTranslatef(.01,0,0); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPushMatrix(); glTranslatef(-.01,0,0); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPushMatrix(); glTranslatef(.0,.01,0); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPushMatrix(); glTranslatef(0,-.01,0); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); } if(drawmode==radialzoommode){ for(i=0;i<3;i++){ //glRotatef((float)i*.1,0,0,1); glColor4f(1,1,1,1/((float)i+1)); glPushMatrix(); glScalef(1+(float)i*.01,1+(float)i*.01,1); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(texcoordwidth,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(texcoordwidth,texcoordheight); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,texcoordheight); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); } } glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } if(console){ glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); int offset = 0; if(consoleselected>=60) offset=consoleselected-60; sprintf (string, " ]"); text.glPrint(10,30,string,0,1,1024,768); if(consoleblink){ sprintf (string, "_"); text.glPrint(30+(float)(consoleselected)*10-offset*10,30,string,0,1,1024,768); } for(i=0;i<15;i++){ for(j=0;j Game::ListCampaigns() { DIR *campaigns = opendir(ConvertFileName(":Data:Campaigns")); struct dirent *campaign = NULL; if(!campaigns) { perror("Problem while loading campaigns"); cerr << "campaign folder was : " << ConvertFileName(":Data:Campaigns") << endl; exit(EXIT_FAILURE); } vector campaignNames; while ((campaign = readdir(campaigns)) != NULL) { string name(campaign->d_name); if(name.length()<5) continue; if(!name.compare(name.length()-4,4,".txt")) { campaignNames.push_back(name.substr(0,name.length()-4)); } } closedir(campaigns); return campaignNames; } void Game::LoadCampaign() { if(!accountactive) return; ifstream ipstream(ConvertFileName((":Data:Campaigns:"+accountactive->getCurrentCampaign()+".txt").c_str())); ipstream.ignore(256,':'); int numlevels; ipstream >> numlevels; campaignlevels.clear(); for(int i=0;i> cl; campaignlevels.push_back(cl); } ipstream.close(); ifstream test(ConvertFileName((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str())); if(test.good()) { LoadTexture((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0); } else { LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); } if(accountactive->getCampaignChoicesMade()==0) { accountactive->setCampaignScore(0); accountactive->resetFasttime(); } } void Game::DrawMenu() { // !!! FIXME: hack: clamp framerate in menu so text input works correctly on fast systems. SDL_Delay(15); glDrawBuffer(GL_BACK); glReadBuffer(GL_BACK); glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); ReSizeGLScene(90,.1f); if(oldmainmenu!=mainmenu){ if(mainmenu==5){ LoadCampaign(); } } oldmainmenu=mainmenu; glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.001f); glEnable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glPushMatrix(); glScalef((float)screenwidth/2,(float)screenheight/2,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_BLEND); glColor4f(0,0,0,1.0); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); glDisable(GL_TEXTURE_2D); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glEnable(GL_BLEND); glColor4f(0.4,0.4,0.4,1.0); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); glEnable(GL_TEXTURE_2D); glBindTexture( GL_TEXTURE_2D, Mainmenuitems[4]); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPopMatrix(); glPopMatrix(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix switch(mainmenu) { case 1: case 2:{ nummenuitems=4; startx[0]=150; starty[0]=480-128; endx[0]=150+256; endy[0]=480; startx[1]=18; starty[1]=480-152-32; endx[1]=18+128; endy[1]=480-152; startx[2]=18; starty[2]=480-228-32; endx[2]=2+128; endy[2]=480-228; if(mainmenu==1){ startx[3]=18; starty[3]=480-306-32; endx[3]=22+64; endy[3]=480-306; } if(mainmenu==2){ startx[3]=18; starty[3]=480-306-32; endx[3]=22+128; endy[3]=480-306; } } break; case 3: { nummenuitems=14; if((float)newscreenwidth>(float)newscreenheight*1.61||(float)newscreenwidth<(float)newscreenheight*1.59)sprintf (menustring[0], "Resolution: %d*%d",(int)newscreenwidth,(int)newscreenheight); else sprintf (menustring[0], "Resolution: %d*%d (widescreen)",(int)newscreenwidth,(int)newscreenheight); startx[0]=10+20; starty[0]=440; if(newdetail==2) sprintf (menustring[1], "Detail: High"); else if(newdetail==1) sprintf (menustring[1], "Detail: Medium"); else sprintf (menustring[1], "Detail: Low"); startx[1]=10+60; starty[1]=405; if(bloodtoggle==2) sprintf (menustring[2], "Blood: On, high detail (slower)"); if(bloodtoggle==1) sprintf (menustring[2], "Blood: On, low detail"); if(bloodtoggle==0) sprintf (menustring[2], "Blood: Off"); startx[2]=10+70; starty[2]=370; if(difficulty==2) sprintf (menustring[3], "Difficulty: Insane"); if(difficulty==1) sprintf (menustring[3], "Difficulty: Difficult"); if(difficulty==0) sprintf (menustring[3], "Difficulty: Easier"); startx[3]=10+20-1000; starty[3]=335-1000; if(ismotionblur==1) sprintf (menustring[4], "Blur Effects: Enabled (less compatible)"); if(ismotionblur==0) sprintf (menustring[4], "Blur Effects: Disabled (more compatible)"); startx[4]=10; starty[4]=335; if(decals==1) sprintf (menustring[5], "Decals: Enabled (slower)"); if(decals==0) sprintf (menustring[5], "Decals: Disabled"); startx[5]=10+60; starty[5]=300; if(musictoggle==1) sprintf (menustring[6], "Music: Enabled"); if(musictoggle==0) sprintf (menustring[6], "Music: Disabled"); startx[6]=10+70; starty[6]=265; if(invertmouse==1) sprintf (menustring[9], "Invert mouse: Yes"); if(invertmouse==0) sprintf (menustring[9], "Invert mouse: No"); startx[9]=10; starty[9]=230; sprintf (menustring[10], "Mouse Speed: %d", (int)(usermousesensitivity*5)); startx[10]=20; starty[10]=195; sprintf (menustring[11], "Volume: %d%%", (int)(volume*100)); startx[11]=10+60; starty[11]=160; sprintf (menustring[13], "Damage Bar: %s",(showdamagebar?"on":"off")); startx[13]=30; starty[13]=125; sprintf (menustring[7], "-Configure Controls-"); startx[7]=10+15; starty[7]=90; sprintf (menustring[12], "-Configure Stereo -"); startx[12]=10+15; starty[12]=55; if(newdetail==detail&&newscreenheight==(int)screenheight&&newscreenwidth==(int)screenwidth)sprintf (menustring[8], "Back"); else sprintf (menustring[8], "Back (some changes take effect next time Lugaru is opened)"); startx[8]=10; starty[8]=10; } break; case 4: { nummenuitems=10; if(keyselect!=0)sprintf (menustring[0], "Forwards: %s",Input::keyToChar(forwardkey)); else sprintf (menustring[0], "Forwards: _"); startx[0]=10; starty[0]=400; if(keyselect!=1)sprintf (menustring[1], "Back: %s",Input::keyToChar(backkey)); else sprintf (menustring[1], "Back: _"); startx[1]=10+40; starty[1]=360; if(keyselect!=2)sprintf (menustring[2], "Left: %s",Input::keyToChar(leftkey)); else sprintf (menustring[2], "Left: _"); startx[2]=10+40; starty[2]=320; if(keyselect!=3)sprintf (menustring[3], "Right: %s",Input::keyToChar(rightkey)); else sprintf (menustring[3], "Right: _"); startx[3]=10+30; starty[3]=280; if(keyselect!=4)sprintf (menustring[4], "Crouch: %s",Input::keyToChar(crouchkey)); else sprintf (menustring[4], "Crouch: _"); startx[4]=10+20; starty[4]=240; if(keyselect!=5)sprintf (menustring[5], "Jump: %s",Input::keyToChar(jumpkey)); else sprintf (menustring[5], "Jump: _"); startx[5]=10+40; starty[5]=200; if(keyselect!=6)sprintf (menustring[6], "Draw: %s",Input::keyToChar(drawkey)); else sprintf (menustring[6], "Draw: _"); startx[6]=10+40; starty[6]=160; if(keyselect!=7)sprintf (menustring[7], "Throw: %s",Input::keyToChar(throwkey)); else sprintf (menustring[7], "Throw: _"); startx[7]=10+30; starty[7]=120; if(keyselect!=8)sprintf (menustring[8], "Attack: %s",Input::keyToChar(attackkey)); else sprintf (menustring[8], "Attack: _"); startx[8]=10+20; starty[8]=80; if(debugmode) { if(keyselect!=9)sprintf (menustring[9], "Console: %s",Input::keyToChar(consolekey)); else sprintf (menustring[9], "Console: _"); startx[9]=10+10; starty[9]=40; nummenuitems++; } sprintf (menustring[nummenuitems-1], "Back"); startx[nummenuitems-1]=10; starty[nummenuitems-1]=10; } break; case 5: { nummenuitems=NB_CAMPAIGN_MENU_ITEM; sprintf (menustring[0], "%s",accountactive->getName()); startx[0]=5; starty[0]=400; sprintf (menustring[1], "Tutorial"); startx[1]=5; starty[1]=300; sprintf (menustring[2], "Challenge"); startx[2]=5; starty[2]=240; sprintf (menustring[3], "Delete User"); startx[3]=400; starty[3]=10; sprintf (menustring[4], "Main Menu"); startx[4]=5; starty[4]=10; sprintf (menustring[5], "Change User"); startx[5]=5; starty[5]=180; sprintf (menustring[6], "Campaign : %s", accountactive->getCurrentCampaign().c_str()); startx[6]=200; starty[6]=420; } break; case 6: { nummenuitems=3; sprintf (menustring[0], "Are you sure you want to delete this user?"); startx[0]=10; starty[0]=400; sprintf (menustring[1], "Yes"); startx[1]=10; starty[1]=360; sprintf (menustring[2], "No"); startx[2]=10; starty[2]=320; } break; case 7: { nummenuitems=Account::getNbAccounts()+2; int num; if(Account::getNbAccounts()<8) sprintf (menustring[0], "New User"); else sprintf (menustring[0], "No More Users"); startx[0]=10; starty[0]=400; if(entername) startx[0]+=10; num=1; for(int i=0;igetName()); startx[num]=10; starty[num]=360-20-20*num; num++; } sprintf (menustring[num], "Back"); startx[num]=10; starty[num]=10; } break; case 8: { nummenuitems=3; sprintf (menustring[0], "Easier"); startx[0]=10; starty[0]=400; sprintf (menustring[1], "Difficult"); startx[1]=10; starty[1]=360; sprintf (menustring[2], "Insane"); startx[2]=10; starty[2]=320; } break; case 9: { nummenuitems=2+numchallengelevels; char temp[255]; for(int i=0;igetHighScore(i)); for(int j=strlen(temp);j<(32-17);j++) strcat(temp," "); name+=temp; sprintf (temp, "%d:",(int)(((int)accountactive->getFastTime(i)-(int)(accountactive->getFastTime(i))%60)/60)); if((int)(accountactive->getFastTime(i))%60<10)strcat(temp,"0"); name+=temp; sprintf (temp, "%d",(int)(accountactive->getFastTime(i))%60); name+=temp; sprintf(menustring[i],"%s",name.c_str()); startx[i]=10; starty[i]=400-i*25; } sprintf (menustring[numchallengelevels], "Back"); startx[numchallengelevels]=10; starty[numchallengelevels]=10; sprintf (menustring[numchallengelevels+1], " High Score Best Time"); startx[numchallengelevels+1]=10; starty[numchallengelevels+1]=440; //numchallengelevels=tempncl; } break; case 10: { nummenuitems=6; char temp[255]; sprintf (menustring[0], "Congratulations!"); startx[0]=220; starty[0]=330; sprintf (menustring[1], "You have avenged your family and"); startx[1]=140; starty[1]=300; sprintf (menustring[2], "restored peace to the island of Lugaru."); startx[2]=110; starty[2]=270; sprintf (menustring[3], "Back"); startx[3]=10; starty[3]=10; for(int i=0;i<255;i++) menustring[4][i]='\0'; sprintf (temp, "Your score:"); strcpy(menustring[4],temp); for(int i=0;i<20;i++) if(menustring[4][i]=='\0') menustring[4][i]=' '; menustring[4][20]='\0'; sprintf (temp, "%d",(int)accountactive->getCampaignScore()); strcat(menustring[4],temp); startx[4]=190; starty[4]=200; for(int i=0;i<255;i++) menustring[5][i]='\0'; sprintf (temp, "Highest score:"); strcpy(menustring[5],temp); for(int i=0;i<20;i++) if(menustring[5][i]=='\0')menustring[5][i]=' '; menustring[5][20]='\0'; sprintf (temp, "%d",(int)accountactive->getCampaignHighScore()); strcat(menustring[5],temp); startx[5]=190; starty[5]=180; } break; case 18: { nummenuitems=4; sprintf (menustring[0], "Stereo mode: %s", StereoModeName(newstereomode)); startx[0]=70; starty[0]=400; sprintf (menustring[1], "Stereo separation: %.3f", stereoseparation); startx[1]=10; starty[1]=360; sprintf (menustring[2], "Reverse stereo: %s", stereoreverse ? "Yes" : "No"); startx[2]=40; starty[2]=320; sprintf (menustring[3], "Back"); startx[3]=10; starty[3]=10; } } if(mainmenu!=1 && mainmenu!=2) { for(int i=0;istartx[i]&&(mousecoordh/screenwidth*640)starty[i]&&480-(mousecoordv/screenheight*480)0) selected=i; } } int numlevelsonmap; if(mainmenu == 5) { numlevelsonmap = accountactive->getCampaignChoicesMade()+(accountactive->getCampaignChoicesMade()>0?campaignlevels[accountactive->getCampaignChoicesMade()-1].nextlevel.size():1); for (int i=0;icampaignlevels[i].getStartX()&& (mousecoordh/screenwidth*640)campaignlevels[i].getStartY()&& 480-(mousecoordv/screenheight*480)1) selectedlong[i]=1; } else { selectedlong[i]-=multiplier*5; if(selectedlong[i]<0) selectedlong[i]=0; } } glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,640,0,480,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glEnable(GL_TEXTURE_2D); for(int j=0;j0) { glColor4f(1,1,1,(1-((float)i)/10-(1-selectedlong[j]))*.25); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(startx[j]-((float)i)*1/2, starty[j]-((float)i)*1/2, 0.0f); glTexCoord2f(1,0); glVertex3f(endx[j]+((float)i)*1/2, starty[j]-((float)i)*1/2, 0.0f); glTexCoord2f(1,1); glVertex3f(endx[j]+((float)i)*1/2, endy[j]+((float)i)*1/2, 0.0f); glTexCoord2f(0,1); glVertex3f(startx[j]-((float)i)*1/2, endy[j]+((float)i)*1/2, 0.0f); glEnd(); glPopMatrix(); } } } if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==18) { glColor4f(1,0,0,1); if( (mainmenu==9) && j>accountactive->getProgress() && (j0) { glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25); if(mainmenu==9&&j>accountactive->getProgress()&&jgetCampaignChoicesMade()){ glColor4f(0.5,0,0,1); endsize=.5; } else { glColor4f(1,0,0,1); endsize=1; } startsize=.5; linestart+=fac*4*startsize; lineend-=fac*4*endsize; glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(linestart.x-offset.x*startsize, linestart.y-offset.y*startsize, 0.0f); glTexCoord2f(1,0); glVertex3f(linestart.x+offset.x*startsize, linestart.y+offset.y*startsize, 0.0f); glTexCoord2f(1,1); glVertex3f(lineend.x+offset.x*endsize, lineend.y+offset.y*endsize, 0.0f); glTexCoord2f(0,1); glVertex3f(lineend.x-offset.x*endsize, lineend.y-offset.y*endsize, 0.0f); glEnd(); glPopMatrix(); glEnable(GL_TEXTURE_2D); } glBindTexture( GL_TEXTURE_2D, Mapcircletexture); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); XYZ midpoint; float itemsize; itemsize=campaignlevels[i].getWidth()/2; midpoint=campaignlevels[i].getCenter(); if(i < accountactive->getCampaignChoicesMade()) { glColor4f(0.5,0,0,1); itemsize*=.5; } else { glColor4f(1,0,0,1); } glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(midpoint.x-itemsize, midpoint.y-itemsize, 0.0f); glTexCoord2f(1,0); glVertex3f(midpoint.x+itemsize, midpoint.y-itemsize, 0.0f); glTexCoord2f(1,1); glVertex3f(midpoint.x+itemsize, midpoint.y+itemsize, 0.0f); glTexCoord2f(0,1); glVertex3f(midpoint.x-itemsize, midpoint.y+itemsize, 0.0f); glEnd(); glPopMatrix(); glEnable(GL_BLEND); for(int j=0;j<10;j++) { if(1-((float)j)/10-(1-selectedlong[NB_CAMPAIGN_MENU_ITEM+i])>0) { glColor4f(1,0,0,(1-((float)j)/10-(1-selectedlong[NB_CAMPAIGN_MENU_ITEM+i]))*.25); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(midpoint.x-itemsize-((float)j)*1/2, midpoint.y-itemsize-((float)j)*1/2, 0.0f); glTexCoord2f(1,0); glVertex3f(midpoint.x+itemsize+((float)j)*1/2, midpoint.y-itemsize-((float)j)*1/2, 0.0f); glTexCoord2f(1,1); glVertex3f(midpoint.x+itemsize+((float)j)*1/2, midpoint.y+itemsize+((float)j)*1/2, 0.0f); glTexCoord2f(0,1); glVertex3f(midpoint.x-itemsize-((float)j)*1/2, midpoint.y+itemsize+((float)j)*1/2, 0.0f); glEnd(); glPopMatrix(); } } glPopMatrix(); glPopMatrix(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix if(i>=accountactive->getCampaignChoicesMade()){ text.glPrintOutlined(0.9,0,0,campaignlevels[i].getStartX()+10, campaignlevels[i].getStartY()-4, campaignlevels[i].description.c_str(),0,0.6,640,480); glDisable(GL_DEPTH_TEST); } } glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(screenwidth/2,screenheight/2,0); glPushMatrix(); glScalef((float)screenwidth/2,(float)screenheight/2,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); glPopMatrix(); if(!waiting) { // hide the cursor while waiting for a key glPushMatrix(); glTranslatef(mousecoordh-screenwidth/2,mousecoordv*-1+screenheight/2,0); glScalef((float)screenwidth/64,(float)screenwidth/64,1); glTranslatef(1,-1,0); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(1,1,1,1); glBindTexture( GL_TEXTURE_2D, cursortexture); glPushMatrix(); //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPopMatrix(); } glPopMatrix(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); if(flashamount>0) { if(flashamount>1)flashamount=1; if(flashdelay<=0)flashamount-=multiplier; flashdelay--; if(flashamount<0)flashamount=0; glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); glDepthMask(0); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glScalef(screenwidth,screenheight,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4f(flashr,flashg,flashb,flashamount); glBegin(GL_QUADS); glVertex3f(0, 0, 0.0f); glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); } } lugaru-0~20110520.1+hge4354.orig/Source/Game.cpp0000644000000000000000000001631211571222446017222 0ustar rootroot#include "Game.h" #include "openal_wrapper.h" #include "SDL_thread.h" extern int mainmenu; int numdialogues; int numdialogueboxes[max_dialogues]; int dialoguetype[max_dialogues]; int dialogueboxlocation[max_dialogues][max_dialoguelength]; float dialogueboxcolor[max_dialogues][max_dialoguelength][3]; int dialogueboxsound[max_dialogues][max_dialoguelength]; char dialoguetext[max_dialogues][max_dialoguelength][128]; char dialoguename[max_dialogues][max_dialoguelength][64]; XYZ dialoguecamera[max_dialogues][max_dialoguelength]; XYZ participantlocation[max_dialogues][10]; int participantfocus[max_dialogues][max_dialoguelength]; int participantaction[max_dialogues][max_dialoguelength]; float participantrotation[max_dialogues][10]; XYZ participantfacing[max_dialogues][max_dialoguelength][10]; float dialoguecamerarotation[max_dialogues][max_dialoguelength]; float dialoguecamerarotation2[max_dialogues][max_dialoguelength]; int indialogue; int whichdialogue; int directing; float dialoguetime; int dialoguegonethrough[20]; Game::Game() { terraintexture = 0; terraintexture2 = 0; terraintexture3 = 0; screentexture = 0; screentexture2 = 0; logotexture = 0; loadscreentexture = 0; Maparrowtexture = 0; Mapboxtexture = 0; Mapcircletexture = 0; cursortexture = 0; memset(Mainmenuitems, 0, sizeof(Mainmenuitems)); nummenuitems = 0; memset(startx, 0, sizeof(startx)); memset(starty, 0, sizeof(starty)); memset(endx, 0, sizeof(endx)); memset(endy, 0, sizeof(endy)); memset(selectedlong, 0, sizeof(selectedlong)); selected = 0; keyselect = 0; indemo = 0; won = 0; entername = 0; memset(menustring, 0, sizeof(menustring)); memset(registrationname, 0, sizeof(registrationname)); registrationnumber = 0; newdetail = 0; newscreenwidth = 0; newscreenheight = 0; gameon = 0; deltah = 0,deltav = 0; mousecoordh = 0,mousecoordv = 0; oldmousecoordh = 0,oldmousecoordv = 0; rotation = 0,rotation2 = 0; // SkyBox skybox; cameramode = 0; olddrawmode = 0; drawmode = 0; firstload = 0; oldbutton = 0; leveltime = 0; loadtime = 0; // Model hawk; // XYZ hawkcoords; // XYZ realhawkcoords; hawktexture = 0; hawkrotation = 0; hawkcalldelay = 0; /* Model eye; Model iris; Model cornea; */ stealthloading = 0; whichchoice = 0; actuallevel = 0; winhotspot = false; windialogue = false; minimap = 0; musictype = 0,oldmusictype = 0,oldoldmusictype = 0; realthreat = 0; // Model rabbit; // XYZ rabbitcoords; // XYZ mapcenter; mapradius = 0; // Text text; fps = 0; // XYZ cameraloc; cameradist = 0; drawtoggle = 0; editorenabled = 0; editortype = 0; editorsize = 0; editorrotation = 0; editorrotation2 = 0; brightness = 0; quit = 0; tryquit = 0; // XYZ pathpoint[30]; numpathpoints = 0; memset(numpathpointconnect, 0, sizeof(numpathpointconnect)); memset(pathpointconnect, 0, sizeof(pathpointconnect)); pathpointselected = 0; endgame = 0; scoreadded = 0; numchallengelevels = 0; console = false; archiveselected = 0; memset(consoletext, 0, sizeof(consoletext)); memset(consolechars, 0, sizeof(consolechars)); chatting = 0; memset(displaytext, 0, sizeof(displaytext)); memset(displaychars, 0, sizeof(displaychars)); memset(displaytime, 0, sizeof(displaytime)); displayblinkdelay = 0; displayblink = 0; displayselected = 0; consolekeydown = 0; consoleblinkdelay = 0; consoleblink = 0; consoleselected = 0; autocam = 0; crouchkey = 0,jumpkey = 0,forwardkey = 0,chatkey = 0,backkey = 0,leftkey = 0,rightkey = 0,drawkey = 0,throwkey = 0,attackkey = 0; consolekey = 0; oldattackkey = 0; loading = 0; talkdelay = 0; numboundaries = 0; // XYZ boundary[360]; whichlevel = 0; oldenvironment = 0; targetlevel = 0; changedelay = 0; memset(musicvolume, 0, sizeof(musicvolume)); memset(oldmusicvolume, 0, sizeof(oldmusicvolume)); musicselected = 0; change = 0; //------------ waiting = false; mainmenu = 0; accountactive = NULL; } typedef struct { Game* game; void (Game::*method)(); } params_thread; void Game::fireSound(int sound) { emit_sound_at(sound); } void Game::inputText(char* str, int* charselected, int* nb_chars) { SDL_Event evenement; if(!waiting) { waiting=true; SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableUNICODE(true); } while(SDL_PollEvent(&evenement)) { switch(evenement.type) { case SDL_KEYDOWN: if(evenement.key.keysym.sym == SDLK_ESCAPE) { for(int i=0;i<255;i++) str[i]=0; *nb_chars=0; *charselected=0; waiting=false; } else if(evenement.key.keysym.sym==SDLK_BACKSPACE){ if((*charselected)!=0) { for(int i=(*charselected)-1;i<255;i++) str[i]=str[i+1]; str[255]=0; (*charselected)--; (*nb_chars)--; } } else if(evenement.key.keysym.sym==SDLK_DELETE){ if((*charselected)<(*nb_chars)){ for(int i=(*charselected);i<255;i++) str[i]=str[i+1]; str[255]=0; (*nb_chars)--; } } else if(evenement.key.keysym.sym==SDLK_HOME){ (*charselected)=0; } else if(evenement.key.keysym.sym==SDLK_END){ (*charselected)=(*nb_chars); } else if(evenement.key.keysym.sym==SDLK_LEFT){ if((*charselected)!=0) (*charselected)--; } else if(evenement.key.keysym.sym==SDLK_RIGHT){ if((*charselected)<(*nb_chars)) (*charselected)++; } else if(evenement.key.keysym.sym==SDLK_RETURN) { waiting=false; } else if(evenement.key.keysym.unicode>=32&&evenement.key.keysym.unicode<127&&(*nb_chars)<60){ for(int i=255;i>=(*charselected)+1;i--) str[i]=str[i-1]; str[*charselected]=evenement.key.keysym.unicode; (*charselected)++; (*nb_chars)++; } break; } } if(!waiting) { SDL_EnableKeyRepeat(0,0); // disable key repeat SDL_EnableUNICODE(false); } } void Game::setKeySelected() { waiting=true; params_thread* data = new params_thread; data->game = this; data->method = &Game::setKeySelected_thread; printf("launch thread\n"); SDL_Thread* thread = SDL_CreateThread(Game::thread, data); if ( thread == NULL ) { fprintf(stderr, "Unable to create thread: %s\n", SDL_GetError()); waiting=false; return; } } void Game::setKeySelected_thread() { int keycode=-1; SDL_Event evenement; while(keycode==-1) { SDL_WaitEvent(&evenement); switch(evenement.type) { case SDL_KEYDOWN: keycode = evenement.key.keysym.sym; break; case SDL_MOUSEBUTTONDOWN: keycode = SDLK_LAST+evenement.button.button; break; default: break; } } if(keycode != SDLK_ESCAPE) { fireSound(); switch(keyselect) { case 0: forwardkey=keycode; break; case 1: backkey=keycode; break; case 2: leftkey=keycode; break; case 3: rightkey=keycode; break; case 4: crouchkey=keycode; break; case 5: jumpkey=keycode; break; case 6: drawkey=keycode; break; case 7: throwkey=keycode; break; case 8: attackkey=keycode; break; case 9: consolekey=keycode; break; default: break; } } keyselect=-1; waiting=false; } int Game::thread(void *data) { params_thread* pt = (params_thread*)data; if(pt) { (pt->game->*(pt->method))(); } } void Game::DrawGL() { if ( stereomode == stereoNone ) { DrawGLScene(stereoCenter); } else { DrawGLScene(stereoLeft); DrawGLScene(stereoRight); } } lugaru-0~20110520.1+hge4354.orig/Source/Text.cpp0000644000000000000000000001533511571222446017301 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /**> HEADER FILES <**/ #include "Text.h" #include "Game.h" extern TGAImageRec texture; void Text::LoadFontTexture(const char *fileName) { GLuint type; LOGFUNC; LOG(std::string("Loading font texture...") + fileName); Game::LoadTexture(fileName, &FontTexture, false, false); /* //Load Image //LoadTGA( fileName ); unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image upload_image( fileNamep ,1); //Is it valid? if(1==1){ //Alpha channel? if ( texture.bpp == 24 ) type = GL_RGB; else type = GL_RGBA; glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); if(!FontTexture)glGenTextures( 1, &FontTexture ); glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glBindTexture( GL_TEXTURE_2D, FontTexture); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, type, GL_UNSIGNED_BYTE, texture.data ); } */ if (base) { glDeleteLists(base, 512); base = 0; } } void Text::BuildFont() // Build Our Font Display List { float cx; // Holds Our X Character Coord float cy; // Holds Our Y Character Coord int loop; LOGFUNC; if (base) { glDeleteLists(base, 512); base = 0; //LOG("Font already created..."); //return; } // base=glGenLists(256); // Creating 256 Display Lists base=glGenLists(512); // Creating 256 Display Lists glBindTexture(GL_TEXTURE_2D, FontTexture); // Select Our Font Texture for (loop=0; loop<512; loop++) // Loop Through All 256 Lists { if (loop < 256) { cx=float(loop%16)/16.0f; // X Position Of Current Character cy=float(loop/16)/16.0f; // Y Position Of Current Character } else { cx=float((loop-256)%16)/16.0f; // X Position Of Current Character cy=float((loop-256)/16)/16.0f; // Y Position Of Current Character } glNewList(base+loop,GL_COMPILE); // Start Building A List glBegin(GL_QUADS); // Use A Quad For Each Character glTexCoord2f(cx,1-cy-0.0625f+.001); // Texture Coord (Bottom Left) glVertex2i(0,0); // Vertex Coord (Bottom Left) glTexCoord2f(cx+0.0625f,1-cy-0.0625f+.001); // Texture Coord (Bottom Right) glVertex2i(16,0); // Vertex Coord (Bottom Right) glTexCoord2f(cx+0.0625f,1-cy-.001); // Texture Coord (Top Right) glVertex2i(16,16); // Vertex Coord (Top Right) glTexCoord2f(cx,1-cy-+.001); // Texture Coord (Top Left) glVertex2i(0,16); // Vertex Coord (Top Left) glEnd(); // Done Building Our Quad (Character) if (loop < 256) glTranslated(10,0,0); // Move To The Right Of The Character else glTranslated(8,0,0); // Move To The Right Of The Character glEndList(); // Done Building The Display List } // Loop Until All 256 Are Built } void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrint(x, y, string, set, size, width, height, 0, strlen(string)); } void Text::_glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end, int offset) // Where The Printing Happens { if (set>1) { set=1; } glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glBindTexture(GL_TEXTURE_2D, FontTexture); // Select Our Font Texture glDisable(GL_DEPTH_TEST); // Disables Depth Testing glDisable(GL_LIGHTING); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,width,0,height,-100,100); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); glTranslated(x,y,0); // Position The Text (0,0 - Bottom Left) glScalef(size,size,1); // Reset The Modelview Matrix glListBase(base-32+(128*set) + offset); // Choose The Font Set (0 or 1) glCallLists(end-start,GL_BYTE,&string[start]); // Write The Text To The Screen glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); } void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 0); } void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrintOutline(x, y, string, set, size, width, height, 0, strlen(string)); } void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 256); } void Text::glPrintOutlined(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrintOutlined(1, 1, 1, x, y, string, set, size, width, height); } void Text::glPrintOutlined(float r, float g, float b, float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glColor4f(0,0,0,1); glPrintOutline( x-2*size, y-2*size, string, set, size*2.5/2, width, height); glColor4f(r,g,b,1); glPrint( x, y, string, set, size, width, height); } Text::Text() { base = 0; FontTexture = 0; } Text::~Text() { if (base) { glDeleteLists(base, 512); base = 0; } if (FontTexture) glDeleteTextures( 1, &FontTexture ); } lugaru-0~20110520.1+hge4354.orig/Source/MacCompatibility.h0000644000000000000000000000525511571222446021254 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MACCOMPATIBLITY_H_ #define _MACCOMPATIBLITY_H_ #if !PLATFORM_MACOSX #include #include #include // stuff to make Mac code compatable with Windows/Linux/etc #if defined(WIN32) && !defined(strcasecmp) #define strcasecmp(a,b) stricmp(a,b) #endif #ifdef _MSC_VER // disable warnings about double to float conversions #pragma warning(disable:4305) #pragma warning(disable:4244) // disable warnings about boolean to int conversions #pragma warning(disable:4800) // disable warning about unreferenced local variables #pragma warning(disable:4101) #endif #ifndef __forceinline # ifdef __GNUC__ # define __forceinline inline __attribute__((always_inline)) # endif #endif typedef bool Boolean; struct Point { short v; short h; }; typedef signed char SInt8; typedef unsigned int UInt32; #include "Random.h" void CopyCStringToPascal( const char* src, unsigned char dst[256]); void CopyPascalStringToC( const unsigned char* src, char* dst); typedef struct AbsoluteTime { unsigned long hi; unsigned long lo; } AbsoluteTime; AbsoluteTime UpTime(); // NOTE: returns time since app started, not system start typedef long Duration; enum { durationMicrosecond = -1, durationMillisecond = 1, durationSecond = 1000, durationMinute = 1000 * 60, durationHour = 1000 * 60 * 60, durationDay = 1000 * 60 * 60 * 24, durationForever = 0x7FFFFFFF, durationImmediate = 0, }; Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b); #ifdef _MSC_VER inline bool isnormal( double x) { int ret = _fpclass( x); return (ret == _FPCLASS_NN || ret == _FPCLASS_PN); } #else #include #endif // fix file names to use '/' instead of ':' char* ConvertFileName( const char* orgfilename, const char *mode = "rb" ); #define fopen( a, b) fopen(ConvertFileName(a, b), b) #endif #endif lugaru-0~20110520.1+hge4354.orig/Source/Objects.cpp0000644000000000000000000007403211571222446017745 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Objects.h" extern XYZ viewer; extern float viewdistance; extern float lightambient[3],lightbrightness[3]; extern float fadestart; extern int environment; extern float texscale; extern Light light; extern float multiplier; extern float gravity; extern FRUSTUM frustum; extern Terrain terrain; extern bool foliage; extern int detail; extern float blurness; extern float windvar; extern float playerdist; extern bool skyboxtexture; //Functions bool Objects::checkcollide(XYZ startpoint,XYZ endpoint,int which){ static XYZ colpoint,colviewer,coltarget; static int i; startpoint.y+=.1; endpoint.y+=.1; startpoint.y-=.1; endpoint.y-=.1; for(i=0;ix/(terrain.size/subdivision*terrain.scale); whichpatchz=p1->z/(terrain.size/subdivision*terrain.scale); if(whichpatchx>=0&&whichpatchz>=0&&whichpatchx0&&terrain.patchobjectnum[whichpatchx][whichpatchz]<500) for(j=0;j_%^*=ZSo=@*ggX<#aT<\zZoĉP6aF-RvH0Ȁ$cw \IWģ"Y2=yf+7禋g24v B,rEnkZBU, 0N⌟jZI0tl>?oFW_98ՆvH%cј@Pƹ@MlY1g.EOb;"BfJhn?]`w9%UavH[<(%z!S6|# 79Ӥ\y|DVQj4y݃ pmdj{ @b]/ϭjS X9x(jΒ3&ˈ fŌh@s,w[N\#&F.mR u/rYޣ_tO+Z{qA=e5fy}N,nTtn: qC-;Ã,<2cBiy iv}QaG yi@[K?\6D/WolG}-w2=m/v= r%EU}mɩޟ)c )giDуQ)*TNRxEu ='S9,x}7#\vP4R7OPe۰a8]^)Цd6mQαȷ:P [.\,XJ`;J̰ßU/CnnJΉ;Zl( Y= pr/Vw?p.|]uqu*9TO8?pH!wID5pg5dn1+?Wf&9I:y͵H&H#[aQgysl9^[C r:5kOe3Baro}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.Z2/g`pkI\^H%){Mw*') 3PV0E@ ;~4?:a >0ٳِ3ղW=$5)p*[c?}_=ŅkʾW[BYE61M+㝮JZԲ{PcY]Bo;֢ ,Yȣ ǥ!nHpzlDaj,AF[m8mk#4P=]=T HloS{SLX`GrmXP믚0 @ h}P2H0m}=S rΫ)zN;%dc]iOiQ`ui|^EM+D= {p_IE;]٪응jMD*ԭN(uN$%Q(tFTkcaEK-/ :r.xi{PԿgֆ;%;;C026'} 3[4Z & Ê=UGW?3)n cA@'-V7!~s)"%u_#$:bI+ٲ_~|_~3J} bWA?mdߊr\, |hA`:j}=LZ dڤ"e-++ Ǽ=E52.l rk2z~,3YZS@,$P,+NSл:A/͆ McPD7 hS̶\pԑd_f6$#k59z@ס/nc sZv?7=V9)J,׸"0;sgo{nܧӶc!:%p;I!f.N.(70n גqFXEK,G¸@|]ïlQIt1{ ; 6zxDDLJ>Q-MnKـu,R7)޵J #=MWRatz߭Aȉ _Vu(Xde7CP"ל-'V`* jќ=iڑb. 45 ⤓5,li ^IU'Ab Eۋ8DrP#/8kdu /R9t $,Jڇ[:ruCQ Rؠ2c*wѣ cQ,Eqj>u.1xq*c90|ӽӘ,<#?cä'Y8o'칸5XA b9iJK1#pL;5VM {N??qz101dsJė}Kز%,ĜikA8EX]GHŮ |EPPq]H]bwrz`*PV h!*ެ;|uȰw bSG.8 _BƛrN#*嗟 /=b48H`1Q%!\ӂ(, VSq5 Z t_?phhL?PD%@ag,]g'ea"YrͫX&4Cil~l o h1'<+dt5zxwq[ 4rn"pN0j :1icnV Blugaru-0~20110520.1+hge4354.orig/Source/Weapons.h0000644000000000000000000000514111571222446017430 0ustar rootroot/* Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. Lugaru is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _WEAPONS_H_ #define _WEAPONS_H_ /**> HEADER FILES <**/ #include "gamegl.h" #include "Quaternions.h" #include "Skeleton.h" #include "Models.h" #include "Terrain.h" #include "Sprite.h" #include "Person.h" #include #define max_weapons 30 #define max_weaponinstances 20 #define knife 1 #define sword 2 #define staff 3 class Weapon { public: Weapon(int type, int owner); static Model throwingknifemodel; static GLuint knifetextureptr; static GLuint lightbloodknifetextureptr; static GLuint bloodknifetextureptr; static Model swordmodel; static GLuint swordtextureptr; static GLuint lightbloodswordtextureptr; static GLuint bloodswordtextureptr; static Model staffmodel; static GLuint stafftextureptr; void Draw(); void DoStuff(int); int getType() { return type; } void setType(int); int owner; XYZ position; XYZ tippoint; XYZ velocity; XYZ tipvelocity; bool missed; bool hitsomething; float freetime; bool firstfree; bool physics; float damage; int bloody; float blooddrip; float blooddripdelay; float rotation1; float rotation2; float rotation3; float bigrotation; float bigtilt; float bigtilt2; float smallrotation; float smallrotation2; private: int type; XYZ oldtippoint; float lastmult; XYZ oldposition; int oldowner; bool onfire; float flamedelay; float mass; float tipmass; float length; float drawhowmany; XYZ lastdrawnposition; XYZ lastdrawntippoint; float lastdrawnrotation1; float lastdrawnrotation2; float lastdrawnrotation3; float lastdrawnbigrotation; float lastdrawnbigtilt; float lastdrawnbigtilt2; float lastdrawnsmallrotation; float lastdrawnsmallrotation2; int lastdrawnanim; }; class Weapons : public std::vector { public: Weapons(); ~Weapons(); int Draw(); void DoStuff(); }; extern Weapons weapons; #endif lugaru-0~20110520.1+hge4354.orig/COMPILING0000644000000000000000000000022011571222445015637 0ustar rootrootWith GNU/Linux : cmake . && make With Mac OS : Use the XCode project. You need to first build the debug and then the release or it won't work. lugaru-0~20110520.1+hge4354.orig/COPYING.txt0000644000000000000000000004307111571222445016257 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.