forked from oerkki/voxelands
Compare commits
38 Commits
Author | SHA1 | Date |
---|---|---|
|
bdfc8e094a | |
|
91c624da27 | |
|
a988191ded | |
|
39f4313f1f | |
|
a779387ef4 | |
|
625f2d250a | |
|
cc6ef1b7c4 | |
|
811956a449 | |
|
10509e4f00 | |
|
8bc17bdba1 | |
|
cf8ca7ed2f | |
|
bc7fef25b0 | |
|
5ef5235593 | |
|
7ca1afdbd0 | |
|
a0f70edc60 | |
|
2f941d22f3 | |
|
bb052b54fa | |
|
db518187da | |
|
309df7954a | |
|
04c4c2dfbe | |
|
ed3b53843c | |
|
d54a1e711e | |
|
af4355b3b6 | |
|
3872e612b0 | |
|
e6c7e6d05f | |
|
453ccf0380 | |
|
a08a724931 | |
|
c489b21a9c | |
|
094bfc7957 | |
|
17e627e8ea | |
|
a357321e8e | |
|
1a46bdfabd | |
|
e2910b4e73 | |
|
f7d3480951 | |
|
617f5c91d4 | |
|
375a1ec93f | |
|
318a9968b9 | |
|
abc4327af6 |
109
CMakeLists.txt
109
CMakeLists.txt
|
@ -1,41 +1,58 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
if(${CMAKE_VERSION} STREQUAL "2.8.2")
|
||||
# bug http://vtk.org/Bug/view.php?id=11020
|
||||
message( WARNING "CMake/CPack version 2.8.2 will not create working .deb packages!")
|
||||
endif(${CMAKE_VERSION} STREQUAL "2.8.2")
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
# Set policies up to 3.9 since we want to enable the IPO option
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.9)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
else()
|
||||
cmake_policy(VERSION 3.9)
|
||||
endif()
|
||||
|
||||
# This can be read from ${PROJECT_NAME} after project() is called
|
||||
project(voxelands)
|
||||
set(PROJECT_NAME_CAPITALIZED "Voxelands")
|
||||
|
||||
# Also remember to set PROTOCOL_VERSION in clientserver.h when releasing
|
||||
set(VERSION_MAJOR 1709)
|
||||
set(VERSION_MAJOR 2404)
|
||||
set(VERSION_MINOR 00)
|
||||
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
|
||||
|
||||
# Change to false for releases
|
||||
set(DEVELOPMENT_BUILD TRUE)
|
||||
|
||||
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
|
||||
if(VERSION_EXTRA)
|
||||
set(VERSION_STRING "${VERSION_STRING}-${VERSION_EXTRA}")
|
||||
elseif(DEVELOPMENT_BUILD)
|
||||
set(VERSION_STRING "${VERSION_STRING}-dev")
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
# Append "-debug" to version string
|
||||
set(VERSION_STRING "${VERSION_STRING}-debug")
|
||||
endif()
|
||||
|
||||
MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***")
|
||||
|
||||
# Configuration options
|
||||
|
||||
set(DEFAULT_RUN_IN_PLACE FALSE)
|
||||
if(WIN32)
|
||||
set(RUN_IN_PLACE 1 CACHE BOOL "Run directly in source directory structure")
|
||||
else()
|
||||
set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure")
|
||||
set(DEFAULT_RUN_IN_PLACE TRUE)
|
||||
endif()
|
||||
set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
|
||||
"Run directly in source directory structure")
|
||||
|
||||
set(BUILD_CLIENT 1 CACHE BOOL "Build client")
|
||||
if(WIN32)
|
||||
set(BUILD_SERVER 0 CACHE BOOL "Build server")
|
||||
else()
|
||||
set(BUILD_SERVER 1 CACHE BOOL "Build server")
|
||||
endif()
|
||||
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
|
||||
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
|
||||
# set(BUILD_UNITTESTS TRUE CACHE BOOL "Build unittests")
|
||||
# set(BUILD_BENCHMARKS FALSE CACHE BOOL "Build benchmarks")
|
||||
|
||||
# conf options for building fresh voxelands.icns from voxelands.svg if a new icon is made.
|
||||
set(REBUILD_ICNS 0 CACHE BOOL "Rebuild icns from voxelands.svg .")
|
||||
set(REBUILD_ICNS FALSE CACHE BOOL "Rebuild icns from voxelands.svg .")
|
||||
|
||||
set(CPU_OPTS 0 CACHE BOOL "Enable CPU optimizations")
|
||||
set(CPU_OPTS FALSE CACHE BOOL "Enable CPU optimizations")
|
||||
set(CPUTYPE native CACHE STRING "CPU to optimize for")
|
||||
set(ENABLE_SSP 1 CACHE BOOL "Enable stack smashing protection")
|
||||
set(ENABLE_SAFESTACK 1 CACHE BOOL "Enable SafeStack if supported (LLVM only)")
|
||||
set(ENABLE_PIE 0 CACHE BOOL "Produce a Position Independent Executable")
|
||||
set(ENABLE_SSP TRUE CACHE BOOL "Enable stack smashing protection")
|
||||
set(ENABLE_SAFESTACK TRUE CACHE BOOL "Enable SafeStack if supported (LLVM only)")
|
||||
set(ENABLE_PIE FALSE CACHE BOOL "Produce a Position Independent Executable")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
# Default to release
|
||||
|
@ -120,25 +137,48 @@ add_subdirectory(src)
|
|||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Fun-Focused Free Software Voxel World Game")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VENDOR "darkrose")
|
||||
set(CPACK_PACKAGE_CONTACT "Lisa 'darkrose' Milne <lisa@ltmnet.com>")
|
||||
set(CPACK_PACKAGE_VENDOR "rudzik8")
|
||||
set(CPACK_PACKAGE_CONTACT "Mikita Wisniewski <rudzik8@protonmail.com>")
|
||||
|
||||
if(WIN32)
|
||||
# For some reason these aren't copied otherwise
|
||||
# NOTE: For some reason now it seems to work without these
|
||||
#if(BUILD_CLIENT)
|
||||
# install(FILES bin/voxelands.exe DESTINATION bin)
|
||||
#endif()
|
||||
#if(BUILD_SERVER)
|
||||
# install(FILES bin/voxelands-server.exe DESTINATION bin)
|
||||
#endif()
|
||||
# Include all dynamically linked runtime libaries such as MSVCRxxx.dll
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
if(RUN_IN_PLACE)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win64")
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
|
||||
# This might be needed for some installer
|
||||
#set(CPACK_PACKAGE_EXECUTABLES bin/voxelands.exe "Voxelands" bin/voxelands-server.exe "Voxelands Server")
|
||||
else()
|
||||
set(CPACK_GENERATOR WIX)
|
||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ".")
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/${PROJECT_NAME_CAPITALIZED}")
|
||||
|
||||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/voxelands-icon.ico")
|
||||
# Supported languages can be found at
|
||||
# http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html
|
||||
#set(CPACK_WIX_CULTURES "ar-SA,bg-BG,ca-ES,hr-HR,cs-CZ,da-DK,nl-NL,en-US,et-EE,fi-FI,fr-FR,de-DE")
|
||||
set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/misc/CPACK_WIX_UI_BANNER.BMP")
|
||||
set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/misc/CPACK_WIX_UI_DIALOG.BMP")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/doc/gpl-3.0.txt")
|
||||
|
||||
# The correct way would be to include both x32 and x64 into one installer
|
||||
# and install the appropriate one.
|
||||
# CMake does not support that, so there are two separate GUID's
|
||||
#if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# set(CPACK_WIX_UPGRADE_GUID "745A0FB3-5552-44CA-A587-A91C397CCC56")
|
||||
#else()
|
||||
# set(CPACK_WIX_UPGRADE_GUID "814A2E2D-2779-4BBD-9ACD-FC3BD51FBBA2")
|
||||
#endif()
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
# TODO
|
||||
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
||||
|
@ -156,10 +196,9 @@ else()
|
|||
set(CPACK_SOURCE_GENERATOR TGZ)
|
||||
SET ( CPACK_DEBIAN_PACKAGE_SECTION "other" )
|
||||
SET ( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
|
||||
SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Lisa Milne <lisa@ltmnet.com>" )
|
||||
SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Mikita Wisniewski <rudzik8@protonmail.com>" )
|
||||
SET ( CPACK_GENERATOR "DEB;RPM" )
|
||||
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
# About
|
||||
|
||||
**Voxelands** is a sandbox construction game based on Minetest 0.3, which was inspired by earlier "voxel world" games such as Infiniminer. Gameplay puts players in a fully destructible 3D game world where they can place and dig numerous types of blocks, items and creatures using a variety of tools. Inside the game world players can build structures, artworks and anything else their creativity can think of on multiplayer servers and singleplayer worlds across multiple game modes.
|
||||
|
||||
# Chats
|
||||
|
||||
Matrix: <https://matrix.to/#/#voxelands-room:matrix.org>
|
||||
|
||||
# Dependencies
|
||||
|
||||
Voxelands requires:
|
||||
* the standard C++ library
|
||||
* irrlicht
|
||||
* freetype
|
||||
* openAL
|
||||
* vorbisfile
|
||||
* ogg
|
||||
* zlib
|
||||
* cmake
|
||||
* make
|
||||
* g++ (or other C++ compiler)
|
||||
* bzip2
|
||||
* jpeg
|
||||
* libxml2
|
||||
|
||||
# Install
|
||||
|
||||
## Download
|
||||
|
||||
Install dependencies. Here's an example for Debian/Ubuntu:
|
||||
|
||||
sudo apt install build-essential libirrlicht-dev cmake libbz2-dev zlib1g-dev libfreetype6-dev libpng-dev libjpeg-dev libogg-dev libvorbis-dev libopenal-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libxml2-dev
|
||||
|
||||
You can install Git for easily keeping your copy up-to-date.
|
||||
If you don’t want Git, read below on how to get the source without Git.
|
||||
|
||||
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
|
||||
|
||||
git clone https://git.minetest.land/oerkki/voxelands.git
|
||||
cd voxelands
|
||||
|
||||
Download source, without using Git:
|
||||
|
||||
wget https://git.minetest.land/oerkki/voxelands/archive/master.tar.gz
|
||||
tar xf master.tar.gz
|
||||
cd voxelands
|
||||
|
||||
## Build
|
||||
|
||||
Build a version that runs directly from the source directory:
|
||||
|
||||
cmake . -DRUN_IN_PLACE=TRUE
|
||||
make -j$(nproc)
|
||||
|
||||
- Use `cmake . -LH` to see all CMake options and their current state.
|
||||
- If you want to install it system-wide (or are making a distribution package),
|
||||
you will want to use `-DRUN_IN_PLACE=FALSE`.
|
||||
- You can build a bare server by specifying `-DBUILD_SERVER=TRUE`.
|
||||
- You can disable the client build by specifying `-DBUILD_CLIENT=FALSE`.
|
||||
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
|
||||
- Debug build is slower, but gives much more useful output in a debugger.
|
||||
|
||||
### Errors
|
||||
|
||||
Some buildings errors are currently known. If the building occured an error, it might be one of them:
|
||||
|
||||
#### Crash when building with translation.
|
||||
|
||||
**Error :**
|
||||
|
||||
[ 2%] Linking CXX static library libcguittfont.a
|
||||
[ 2%] Built target cguittfont
|
||||
make: *** [Makefile:152 : all] Erreur 2
|
||||
|
||||
**Git issue:** [#19](https://git.minetest.land/oerkki/voxelands/issues/19)
|
||||
|
||||
**Possible fixes:**
|
||||
|
||||
1. Change your default build language to english: (Add the `sudo` keyword for ubuntu-based devices)
|
||||
apt-get install language-pack-en
|
||||
dpkg-reconfigure locales
|
||||
|
||||
2. Delete translations files by simply deleting the `po` folder.
|
||||
|
||||
#### The `-DRUN_IN_PLACE` CMake option doesn't work.
|
||||
|
||||
**Git issue:** [#19](https://git.minetest.land/oerkki/voxelands/issues/11)
|
||||
|
||||
This error is fixed since the version 2404 of Voxelands. If you get them, check if the dowloaded version is the good one.
|
||||
|
||||
# Use
|
||||
|
||||
Simply run `./bin/voxelands` from any console/terminal.
|
||||
|
||||
# Controls
|
||||
|
||||
Controls can be set in the Settings tab of the main menu
|
||||
|
||||
| Button | Action |
|
||||
| ------------------ | --------------------------------------- |
|
||||
| W, S, A, D | Walk forward, backward, left, and right |
|
||||
| Mouse | Look / Aim |
|
||||
| Mouse wheel | Change wielded item |
|
||||
| 1 through 8 | Change wielded item |
|
||||
| Right Mouse Button | Place item |
|
||||
| Left Mouse Button | Dig / Punch / Attack |
|
||||
| Shift | Sneak |
|
||||
| Space | Jump |
|
||||
| R | Move Up (ladders, swimming, flying) |
|
||||
| F | Move Down (ladders, swimming, flying) |
|
||||
| E | Run |
|
||||
| I | Enter inventory |
|
||||
| Q | Examine pointed block |
|
||||
| H | Use item in hand |
|
||||
| T | Talk / commands |
|
||||
| K | Toggle fly mode |
|
||||
| F1 | Hide / show hud |
|
||||
| F2 | Hide / show chat |
|
||||
| F3 | Disable / enable fog |
|
||||
| F4 | Disable / enable camera update |
|
||||
| F5 | Toggle through debug information |
|
||||
| F6 | Toggle through profiler |
|
||||
| F12 | Take a screenshot |
|
||||
|
||||
# License
|
||||
|
||||
**Code:**
|
||||
|
||||
Voxelands is licensed under the GPLv3 or later.
|
||||
|
||||
Copyright (c) 2022-2022 Mikita Wisniewski <rudzik8@protonmail.com>
|
||||
|
||||
Copyright (c) 2013-2016 Lisa 'darkrose' Milne <lisa@ltmnet.com>
|
||||
|
||||
Forked from Minetest 0.3.x
|
||||
|
||||
Copyright (c) 2010-2011 Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
See commits history for all contributors.
|
||||
|
||||
**Textures, Sounds, and Models:**
|
||||
|
||||
This does not apply to packs made by others.
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
To satisfy the attribution clause, any project using Voxelands' assets must provide a prominent notice as part of each of said project's credits notices (such as in documentation, on a website, and/or any other credits screen associated with the project) showing both the CC-BY-SA licensing, the ownership by Voxelands of the asset, and a link to the Voxelands' project at https://git.minetest.land/oerkki/voxelands/.
|
||||
|
||||
**Artists include:**
|
||||
|
||||
* sdzen
|
||||
* darkrose
|
||||
* sapier
|
||||
* Tom Peter
|
||||
* Telaron
|
||||
* juskiddink
|
||||
|
||||
With special thanks to http://www.opengameart.org/
|
||||
|
||||
# Development
|
||||
|
||||
Voxelands is under active development, the latest updates can be found at https://git.minetest.land/oerkki/voxelands
|
113
README.txt
113
README.txt
|
@ -1,113 +0,0 @@
|
|||
========================================================================
|
||||
README
|
||||
========================================================================
|
||||
|
||||
ABOUT:
|
||||
Voxelands is a sandbox construction game based on Minetest, which was
|
||||
inspired by earlier "voxel world" games such as Infiniminer. Gameplay
|
||||
puts players in a fully destructible 3D game world where they can place
|
||||
and dig numerous types of blocks, items and creatures using a variety
|
||||
of tools. Inside the game world players can build structures, artworks
|
||||
and anything else their creativity can think of on multiplayer servers
|
||||
and singleplayer worlds across multiple game modes.
|
||||
|
||||
DEPENDENCIES:
|
||||
Voxelands requires the standard C++ library, irrlicht 1.8 or later,
|
||||
freetype, openAL, vorbisfile, ogg, zlib. CMake, make, and g++ (or other
|
||||
C++ compiler) and bzip2 and jpeg are required to build from source.
|
||||
|
||||
INSTALL:
|
||||
If you're reading this then you've already unpacked the tarball, so
|
||||
just:
|
||||
1) cd /path/to/voxelands
|
||||
2) cmake -DRUN_IN_PLACE=1 .
|
||||
3) make -j3
|
||||
|
||||
Other optional cmake parameters:
|
||||
1) -DBUILD_SERVER=0 (default 1) builds the dedicated server
|
||||
2) -DBUILD_CLIENT=0 (default 1) builds the rich client
|
||||
3) -DENABLE_AUDIO=0 (default 1) enables audio support
|
||||
|
||||
The option -DRUN_IN_PLACE expects the user to run voxelands from the extracted source directory.
|
||||
|
||||
WINDOWS:
|
||||
Voxelands can be cross compiled with mingw, or built natively with MSVC,
|
||||
instructions for the latter are available on the forums:
|
||||
http://forum.voxelands.com
|
||||
|
||||
USE:
|
||||
Simply run bin/voxelands from any console/terminal.
|
||||
|
||||
CONTROLS:
|
||||
Controls can be set in the Settings tab of the main menu
|
||||
|
||||
Main controls:
|
||||
|
||||
W, S, A, D - Walk forward backward, left, and right.
|
||||
Mouse - Look / Aim.
|
||||
Mouse wheel - Change wielded item.
|
||||
1 through 8 - Change wielded item.
|
||||
Right Mouse Button - Place item.
|
||||
Left Mouse Button - Dig / Punch / Attack.
|
||||
Shift - Sneak.
|
||||
Space - Jump.
|
||||
R - Move Up (ladders, swimming, flying)
|
||||
F - Move Down (ladders, swimming, flying)
|
||||
E - Run.
|
||||
|
||||
Action controls:
|
||||
|
||||
I - Enter inventory.
|
||||
Q - Examine pointed block.
|
||||
H - Use item in hand.
|
||||
=======
|
||||
T - Talk / commands.
|
||||
K - Toggle fly mode.
|
||||
F1 - Hide / show hud.
|
||||
F2 - Hide / show chat.
|
||||
F3 - Disable / enable fog.
|
||||
F4 - Disable / enable camera update.
|
||||
F5 - Toggle through debug information.
|
||||
F6 - Toggle through profiler (info on FPS, chunk updates, etc.)
|
||||
F12 - Take a screenshot.
|
||||
|
||||
|
||||
LICENSE:
|
||||
Code:
|
||||
Voxelands is licensed under the GPLv3 or later.
|
||||
Copyright (c) 2013-2016 Lisa 'darkrose' Milne <lisa@ltmnet.com>
|
||||
Forked from Minetest 0.3.x
|
||||
Copyright (c) 2010-2011 Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
Textures, Sounds, and Models:
|
||||
|
||||
This does not apply to texture packs made by others.
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
To satisfy the attribution clause, any project using Voxelands' assets
|
||||
must provide a prominent notice as part of each of said project's
|
||||
credits notices (such as in documentation, on a website, and/or any
|
||||
other credits screen associated with the project) showing both the
|
||||
CC-BY-SA licensing, the ownership by Voxelands of the asset, and a link
|
||||
to the Voxelands' project at http://www.voxelands.com/.
|
||||
|
||||
Artists include:
|
||||
sdzen
|
||||
darkrose
|
||||
sapier
|
||||
Tom Peter
|
||||
Telaron
|
||||
juskiddink
|
||||
With special thanks to http://www.opengameart.org/
|
||||
|
||||
DEVELOPMENT:
|
||||
Voxelands is under active development, the latest updates can be found
|
||||
at:
|
||||
https://gitlab.com/voxelands/voxelands
|
||||
or on IRC at:
|
||||
irc.entropynet.net #voxelands
|
||||
|
||||
CHANGES:
|
||||
See doc/changelog.txt
|
|
@ -1,28 +1,69 @@
|
|||
# Package finder for gettext libs and include files
|
||||
|
||||
SET(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
|
||||
set(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
|
||||
CACHE FILEPATH "path to custom gettext")
|
||||
|
||||
# by default
|
||||
SET(GETTEXT_FOUND FALSE)
|
||||
find_path(GETTEXT_INCLUDE_DIR
|
||||
NAMES libintl.h
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/include"
|
||||
DOC "GetText include directory")
|
||||
|
||||
FIND_PROGRAM(GETTEXT_MSGFMT
|
||||
find_program(GETTEXT_MSGFMT
|
||||
NAMES msgfmt
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
||||
DOC "path to msgfmt")
|
||||
DOC "Path to msgfmt")
|
||||
|
||||
IF(GETTEXT_MSGFMT)
|
||||
SET(GETTEXT_FOUND TRUE)
|
||||
SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
|
||||
SET(GETTEXT_MO_BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../data/locale/<locale>)
|
||||
SET(GETTEXT_MO_DEST_PATH ${SHAREDIR}/locale/<locale>)
|
||||
FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
|
||||
LIST(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES voxelands.pot)
|
||||
MACRO(SET_MO_PATHS _buildvar _destvar _locale)
|
||||
STRING(REPLACE "<locale>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH})
|
||||
STRING(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH})
|
||||
ENDMACRO(SET_MO_PATHS)
|
||||
ELSE()
|
||||
SET(GETTEXT_INCLUDE_DIR "")
|
||||
SET(GETTEXT_LIBRARY "")
|
||||
ENDIF()
|
||||
set(GETTEXT_REQUIRED_VARS GETTEXT_INCLUDE_DIR GETTEXT_MSGFMT)
|
||||
|
||||
if(APPLE)
|
||||
find_library(GETTEXT_LIBRARY
|
||||
NAMES libintl.a
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "GetText library")
|
||||
|
||||
find_library(ICONV_LIBRARY
|
||||
NAMES libiconv.dylib
|
||||
PATHS "/usr/lib"
|
||||
DOC "IConv library")
|
||||
set(GETTEXT_REQUIRED_VARS ${GETTEXT_REQUIRED_VARS} GETTEXT_LIBRARY ICONV_LIBRARY)
|
||||
endif(APPLE)
|
||||
|
||||
# Modern Linux, as well as OSX, does not require special linking because
|
||||
# GetText is part of glibc.
|
||||
# TODO: check the requirements on other BSDs and older Linux
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(GETTEXT_LIB_NAMES
|
||||
libintl.lib intl.lib libintl3.lib intl3.lib)
|
||||
else()
|
||||
set(GETTEXT_LIB_NAMES
|
||||
libintl.dll.a intl.dll.a libintl3.dll.a intl3.dll.a)
|
||||
endif()
|
||||
find_library(GETTEXT_LIBRARY
|
||||
NAMES ${GETTEXT_LIB_NAMES}
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "GetText library")
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GettextLib DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})
|
||||
|
||||
|
||||
if(GETTEXTLIB_FOUND)
|
||||
# BSD variants require special linkage as they don't use glibc
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
|
||||
set(GETTEXT_LIBRARY "intl")
|
||||
endif()
|
||||
|
||||
set(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
|
||||
set(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale/<locale>/LC_MESSAGES)
|
||||
set(GETTEXT_MO_DEST_PATH ${LOCALEDIR}/<locale>/LC_MESSAGES)
|
||||
file(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
|
||||
list(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES minetest.pot)
|
||||
list(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES timestamp)
|
||||
macro(SET_MO_PATHS _buildvar _destvar _locale)
|
||||
string(REPLACE "<locale>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH})
|
||||
string(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH})
|
||||
endmacro()
|
||||
endif()
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 124 B |
Binary file not shown.
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 265 B |
|
@ -0,0 +1,36 @@
|
|||
# Voxelands Direction Document
|
||||
|
||||
Styling based on [Minetest Direction Document](https://github.com/minetest/minetest/blob/master/doc/direction.md).
|
||||
|
||||
## 1. Long-term Roadmap
|
||||
|
||||
Currently not much was done to the game and LTR can be changed in
|
||||
future. But still, our long-term roadmap currently contains 3 things:
|
||||
|
||||
1. Use more of Minetest things to add solid backing (less to maintain)
|
||||
2. Be a complete voxel sandbox game working OOTB (just like MC)
|
||||
3. Be more voxel than cubic (more meshes and nodeboxes)
|
||||
|
||||
## 2. Medium-term Roadmap
|
||||
|
||||
The medium-term roadmap currently contains 5 things to add/change:
|
||||
|
||||
1. Modding (implement as Game+Mods (MC-alike), not Game=Mods (MT-alike))
|
||||
2. Packs (texturepacks, soundpacks, modelpacks, resourcepacks) (#14)
|
||||
3. Graphics (fix weird glitches and switch to IrrlichtMT) (#2)
|
||||
4. Workflow (add more people to the development, automatize releasing)
|
||||
5. Site (online page for Voxelands based on the voxelands-www repo)
|
||||
|
||||
## 3. Short-term Roadmap
|
||||
|
||||
The short-term roadmap is temporary, it's here only while critical bugs
|
||||
(like crashes) aren't fixed.
|
||||
|
||||
We can count these things as a short-term roadmap:
|
||||
|
||||
1. Fix everything crashing (#1)
|
||||
2. Convert most of the docs from plaintext to markdown
|
||||
3. Do something with changelogs
|
||||
|
||||
After these are done, this section won't be here anymore and we'll count
|
||||
(bug/crash)-labeled issues as short-term by default.
|
|
@ -285,6 +285,7 @@ endif()
|
|||
set(voxelands_SRCS
|
||||
${common_SRCS}
|
||||
${audio_SRCS}
|
||||
tutorial.cpp
|
||||
sky.cpp
|
||||
hud.cpp
|
||||
content_mapblock.cpp
|
||||
|
@ -321,11 +322,11 @@ set(voxelandsserver_SRCS
|
|||
)
|
||||
|
||||
include_directories(
|
||||
${voxelands_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/src/jthread
|
||||
${PROJECT_BINARY_DIR}
|
||||
${IRRLICHT_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${CMAKE_BUILD_TYPE}
|
||||
${PNG_INCLUDE_DIR}
|
||||
${AUDIO_INCLUDE_DIRS}
|
||||
${JTHREAD_INCLUDE_DIR}
|
||||
|
|
106
src/config.c
106
src/config.c
|
@ -43,6 +43,13 @@ typedef struct config_s {
|
|||
int (*setter)(char* v);
|
||||
} config_t;
|
||||
|
||||
typedef struct sort_s {
|
||||
struct sort_s *prev;
|
||||
struct sort_s *next;
|
||||
char *name;
|
||||
char *value;
|
||||
} sort_t;
|
||||
|
||||
/* get the value of a config setting */
|
||||
char* config_get(char* name)
|
||||
{
|
||||
|
@ -393,12 +400,111 @@ void config_save(char* section, char* type, char* file)
|
|||
n = n->next;
|
||||
}
|
||||
}else{
|
||||
sort_t *copyhead = 0;
|
||||
sort_t *copytail = 0;
|
||||
sort_t *copying = 0;
|
||||
sort_t *copied = 0;
|
||||
int copy_failed=0;
|
||||
|
||||
// get config name/value pairs in new list
|
||||
n = config.items;
|
||||
while(n) {
|
||||
if (!n->name) continue;
|
||||
copying=malloc(sizeof(sort_t));
|
||||
if (!copying) {
|
||||
copy_failed=1;
|
||||
break;
|
||||
}
|
||||
if (!copyhead)
|
||||
// remember the first entry in the list for sorting
|
||||
copyhead=copying;
|
||||
if (copied) {
|
||||
copied->next = copying;
|
||||
copying->prev = copied;
|
||||
}
|
||||
else {
|
||||
copying->prev = 0;
|
||||
}
|
||||
|
||||
copying->name = strdup(n->name);
|
||||
if (n->value)
|
||||
copying->value = strdup(n->value);
|
||||
else
|
||||
copying->value = 0;
|
||||
|
||||
copying->next = 0;
|
||||
copied = copying;
|
||||
n = n->next;
|
||||
}
|
||||
// remember the last entry in the list for cleaning up
|
||||
copytail=copied;
|
||||
|
||||
// alpha sort name/value pairs by name
|
||||
sort_t *sprev;
|
||||
sort_t *scurr;
|
||||
char *store;
|
||||
|
||||
if (!copy_failed && copyhead) {
|
||||
scurr=copyhead;
|
||||
while(scurr->next){
|
||||
if (strcmp(scurr->name,scurr->next->name)>0){
|
||||
store=scurr->name;
|
||||
scurr->name = scurr->next->name;
|
||||
scurr->next->name = store;
|
||||
store=scurr->value;
|
||||
scurr->value=scurr->next->value;
|
||||
scurr->next->value=store;
|
||||
sprev=scurr;
|
||||
while(sprev->prev){
|
||||
if (strcmp(sprev->prev->name,sprev->name) > 0) {
|
||||
store=sprev->name;
|
||||
sprev->name = sprev->prev->name;
|
||||
sprev->prev->name = store;
|
||||
store=sprev->value;
|
||||
sprev->value = sprev->prev->value;
|
||||
sprev->prev->value=store;
|
||||
sprev=sprev->prev;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
scurr=scurr->next;
|
||||
}
|
||||
}
|
||||
|
||||
// save one of the lists to file
|
||||
if (copy_failed) {
|
||||
while (n) {
|
||||
if (n->value)
|
||||
file_writef(f,"set %s %s\n",n->name,n->value);
|
||||
n = n->next;
|
||||
}
|
||||
} else {
|
||||
scurr=copyhead;
|
||||
while (scurr) {
|
||||
if (scurr->value)
|
||||
file_writef(f,"set %s %s\n",scurr->name,scurr->value);
|
||||
scurr=scurr->next;
|
||||
}
|
||||
}
|
||||
|
||||
// free list memory and clean up
|
||||
while(copytail) {
|
||||
if (!(copytail->prev)) break;
|
||||
copytail=copytail->prev;
|
||||
free(copytail->next);
|
||||
copytail->next=0;
|
||||
}
|
||||
free(copytail);
|
||||
|
||||
copyhead=0;
|
||||
copytail=0;
|
||||
copying=0;
|
||||
copied=0;
|
||||
sprev=0;
|
||||
scurr=0;
|
||||
store=0;
|
||||
|
||||
/*
|
||||
events_save(f);
|
||||
*/
|
||||
|
|
|
@ -87,7 +87,7 @@ void config_default_init()
|
|||
config_set_default("client.ui.hud.wieldindex","false",NULL);
|
||||
config_set_default("client.ui.mouse.invert","false",NULL);
|
||||
config_set_default("client.ui.mouse.sensitivity","0.2",NULL);
|
||||
config_set_default("client.ui.font","unifont.ttf",NULL);
|
||||
config_set_default("client.ui.font","arimo.ttf",NULL);
|
||||
config_set_default("client.ui.font.size","14",NULL);
|
||||
|
||||
config_set_default("client.chunk.timeout","600",NULL);
|
||||
|
|
|
@ -987,19 +987,20 @@ FoundReverseRecipe getReverseRecipe(InventoryItem *iitem, int index)
|
|||
}
|
||||
|
||||
//how to update an ingredient list given a range of new craft items
|
||||
void addToIngredientList(std::vector<listdata_t> results, uint32_t begin, std::vector<content_t>& ingredient_list)
|
||||
void addToIngredientList(contentlist_t *list, uint32_t begin, std::vector<content_t>& ingredient_list)
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
//make a set to hold the items as the list is compiled
|
||||
set<content_t> ingredients (ingredient_list.begin(), ingredient_list.end());
|
||||
|
||||
//go through the result list
|
||||
for (std::vector<listdata_t>::iterator it = results.begin()+begin; it != results.end(); ++it) {
|
||||
listdata_t *d = list->data;
|
||||
|
||||
//go through the result list
|
||||
while (d) {
|
||||
|
||||
listdata_t d = *it;
|
||||
//make a temporary inventory item for the result
|
||||
InventoryItem *result = InventoryItem::create(d.content, 1, 0, d.data);
|
||||
InventoryItem *result = InventoryItem::create(d->content, 1, 0, d->data);
|
||||
|
||||
//go through every recipe for this item
|
||||
for (int rec_ind = getRecipeCount(result); rec_ind--;) {
|
||||
|
@ -1020,6 +1021,8 @@ void addToIngredientList(std::vector<listdata_t> results, uint32_t begin, std::v
|
|||
|
||||
//clean up
|
||||
delete result;
|
||||
|
||||
d = d->next;
|
||||
}
|
||||
|
||||
//ignore CONTENT_IGNORE
|
||||
|
@ -1050,8 +1053,7 @@ std::vector<content_t>& getCraftGuideIngredientList()
|
|||
if (list_size > last_craftguide_count) {
|
||||
|
||||
//if so, add the new stuff
|
||||
/* TODO: basically everything for reverse lookup */
|
||||
//addToIngredientList(craft_list, last_craftguide_count, ingredient_list);
|
||||
addToIngredientList(cl, last_craftguide_count, ingredient_list);
|
||||
|
||||
//and update the craftguide count
|
||||
last_craftguide_count = list_size;
|
||||
|
|
|
@ -1128,6 +1128,7 @@ void content_mapnode_plants(bool repeat)
|
|||
f->ondig_gives_inventory = true;
|
||||
f->setAllTextures("bush_blueberry.png");
|
||||
f->setAllMetaTextures("bush_blueberry_berry.png");
|
||||
f->setInventoryTextureNodeBox(i,"bush_blueberry.png", "bush_blueberry.png", "bush_blueberry.png");
|
||||
#ifndef SERVER
|
||||
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
|
||||
f->setAllTextureFlags(0);
|
||||
|
@ -1158,6 +1159,7 @@ void content_mapnode_plants(bool repeat)
|
|||
f->ondig_gives_inventory = true;
|
||||
f->setAllTextures("bush_raspberry.png");
|
||||
f->setAllMetaTextures("bush_raspberry_berry.png");
|
||||
f->setInventoryTextureNodeBox(i,"bush_raspberry.png", "bush_raspberry.png", "bush_raspberry.png");
|
||||
#ifndef SERVER
|
||||
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
|
||||
f->setAllTextureFlags(0);
|
||||
|
|
|
@ -761,8 +761,9 @@ void content_mapnode_special(bool repeat)
|
|||
f->dig_time = 1.0;
|
||||
f->pressure_type = CST_CRUSHABLE;
|
||||
f->suffocation_per_second = 0;
|
||||
crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_MITHRIL_RAW,i);
|
||||
crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_MITHRIL_UNBOUND,i);
|
||||
//not going to use mithril when you can use sticks
|
||||
//crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_MITHRIL_RAW,i);
|
||||
//crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_MITHRIL_UNBOUND,i);
|
||||
{
|
||||
content_t r[9] = {
|
||||
CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE,
|
||||
|
|
|
@ -1419,10 +1419,10 @@ void content_nodebox_clock(ContentFeatures *f)
|
|||
-0.4375*BS,0.1875*BS,-0.125*BS,0.4375*BS,0.25*BS,-0.0625*BS
|
||||
));
|
||||
f->addNodeBox(NodeBox(
|
||||
0.*BS,-0.0625*BS,-0.125*BS,0.0625*BS,0.*BS,-0.0625*BS
|
||||
-0.02*BS,-0.0625*BS,-0.125*BS,0.0225*BS,0.*BS,-0.0625*BS
|
||||
));
|
||||
f->addNodeBox(NodeBox(
|
||||
0.*BS,-0.1875*BS,-0.125*BS,0.0625*BS,-0.125*BS,-0.0625*BS
|
||||
-0.02*BS,-0.1875*BS,-0.125*BS,0.0225*BS,-0.125*BS,-0.0625*BS
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -287,9 +287,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_pick_stone.png^tool_binding_pick.png";
|
||||
f->description = gettext("Stone Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 32;
|
||||
f->diginfo.time = 3.0;
|
||||
f->diginfo.level = 1;
|
||||
f->diginfo.uses = STONE_USES;
|
||||
f->diginfo.time = STONE_TIME;
|
||||
f->diginfo.level = STONE_LEVEL;
|
||||
{
|
||||
content_t r[9] = {
|
||||
CONTENT_ROCK, CONTENT_ROCK, CONTENT_ROCK,
|
||||
|
@ -303,41 +303,41 @@ void content_toolitem_init()
|
|||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_PICK;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_pick_copper.png^tool_binding_pick.png";
|
||||
f->description = gettext("Copper Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 2;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_FLINTPICK;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_pick_flint.png^tool_binding_pick.png";
|
||||
f->description = gettext("Flint Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = FLINT_LEVEL;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTPICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_PICK;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_pick_copper.png^tool_binding_pick.png";
|
||||
f->description = gettext("Copper Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = COPPER_LEVEL;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_BRONZE_PICK;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_pick_bronze.png^tool_binding_pick.png";
|
||||
f->description = gettext("Bronze Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.25;
|
||||
f->diginfo.level = 3;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = BRONZE_LEVEL;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -348,9 +348,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_pick_iron.png^tool_binding_pick.png";
|
||||
f->description = gettext("Iron Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = IRON_LEVEL;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -361,9 +361,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_pick_mithril.png^tool_binding_pick.png";
|
||||
f->description = gettext("Unbound Mithril Pick");
|
||||
f->type = TT_PICK;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.6;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = U_MITHRIL_LEVEL;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -375,9 +375,9 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Pick");
|
||||
f->type = TT_PICK;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.4;
|
||||
f->diginfo.level = 6;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = E_MITHRIL_LEVEL;
|
||||
f->has_punch_effect = false;
|
||||
crafting::setPickRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_PICK);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -403,49 +403,36 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_shovel_stone.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Stone Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 32;
|
||||
f->diginfo.time = 3.0;
|
||||
f->diginfo.level = 1;
|
||||
f->diginfo.uses = STONE_USES;
|
||||
f->diginfo.time = STONE_TIME;
|
||||
f->diginfo.level = STONE_LEVEL;
|
||||
crafting::set1over1Recipe(CONTENT_ROCK,CONTENT_CRAFTITEM_STICK,i);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_SHOVEL;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_shovel_copper.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Copper Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_FLINTSHOVEL;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_shovel_flint.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Flint Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.75;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = FLINT_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_SHOVEL;
|
||||
i = CONTENT_TOOLITEM_COPPER_SHOVEL;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_shovel_iron.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Iron Shovel");
|
||||
f->texture = "tool_handle.png^tool_head_shovel_copper.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Copper Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 3;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SHOVEL);
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = COPPER_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
|
@ -455,22 +442,35 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_shovel_bronze.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Bronze Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 512;
|
||||
f->diginfo.time = 0.75;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = BRONZE_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_SHOVEL;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_shovel_iron.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Iron Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = IRON_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_SHOVEL;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_shovel_mithril.png^tool_binding_shovel.png";
|
||||
f->description = gettext("Unbound Mithril Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.6;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = U_MITHRIL_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -482,9 +482,9 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Shovel");
|
||||
f->type = TT_SHOVEL;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.4;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = E_MITHRIL_LEVEL;
|
||||
crafting::setShovelRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SHOVEL);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
||||
|
@ -496,9 +496,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_axe_stone.png^tool_binding_axe.png";
|
||||
f->description = gettext("Stone Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 32;
|
||||
f->diginfo.time = 3.0;
|
||||
f->diginfo.level = 1;
|
||||
f->diginfo.uses = STONE_USES;
|
||||
f->diginfo.time = STONE_TIME;
|
||||
f->diginfo.level = STONE_LEVEL;
|
||||
{
|
||||
content_t r[9] = {
|
||||
CONTENT_ROCK, CONTENT_ROCK, CONTENT_IGNORE,
|
||||
|
@ -513,42 +513,29 @@ void content_toolitem_init()
|
|||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_AXE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_axe_copper.png^tool_binding_axe.png";
|
||||
f->description = gettext("Copper Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_FLINTAXE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_axe_flint.png^tool_binding_axe.png";
|
||||
f->description = gettext("Flint Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.75;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = FLINT_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTAXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_AXE;
|
||||
i = CONTENT_TOOLITEM_COPPER_AXE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_axe_iron.png^tool_binding_axe.png";
|
||||
f->description = gettext("Iron Axe");
|
||||
f->texture = "tool_handle.png^tool_head_axe_copper.png^tool_binding_axe.png";
|
||||
f->description = gettext("Copper Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 3;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_AXE);
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = COPPER_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
|
@ -558,22 +545,35 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_axe_bronze.png^tool_binding_axe.png";
|
||||
f->description = gettext("Bronze Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 512;
|
||||
f->diginfo.time = 0.75;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = BRONZE_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_AXE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_axe_iron.png^tool_binding_axe.png";
|
||||
f->description = gettext("Iron Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = IRON_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_AXE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle.png^tool_head_axe_mithril.png^tool_binding_axe.png";
|
||||
f->description = gettext("Unbound Mithril Axe");
|
||||
f->type = TT_AXE;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.6;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = U_MITHRIL_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -585,9 +585,9 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Axe");
|
||||
f->type = TT_AXE;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.4;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = E_MITHRIL_LEVEL;
|
||||
crafting::setAxeRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_AXE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
||||
|
@ -613,9 +613,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_bow.png";
|
||||
f->description = gettext("Bow");
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = BOW_USES;
|
||||
f->diginfo.time = BOW_TIME;
|
||||
f->diginfo.level = BOW_LEVEL;
|
||||
f->thrown_item = CONTENT_CRAFTITEM_ARROW;
|
||||
{
|
||||
content_t r[9] = {
|
||||
|
@ -636,49 +636,36 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle_long.png^tool_head_spear_stone.png^tool_binding_spear.png";
|
||||
f->description = gettext("Stone Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.uses = STONE_USES;
|
||||
f->diginfo.time = STONE_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_ROCK,CONTENT_TOOLITEM_STONE_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_SPEAR;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_copper.png^tool_binding_spear.png";
|
||||
f->description = gettext("Copper Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_FLINTSPEAR;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_flint.png^tool_binding_spear.png";
|
||||
f->description = gettext("Flint Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.75;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_SPEAR;
|
||||
i = CONTENT_TOOLITEM_COPPER_SPEAR;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_iron.png^tool_binding_spear.png";
|
||||
f->description = gettext("Iron Spear");
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_copper.png^tool_binding_spear.png";
|
||||
f->description = gettext("Copper Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 3;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SPEAR);
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
|
@ -688,22 +675,35 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle_long.png^tool_head_spear_bronze.png^tool_binding_spear.png";
|
||||
f->description = gettext("Bronze Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 512;
|
||||
f->diginfo.time = 0.75;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_IRON_SPEAR;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_iron.png^tool_binding_spear.png";
|
||||
f->description = gettext("Iron Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_SPEAR;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_long.png^tool_head_spear_mithril.png^tool_binding_spear.png";
|
||||
f->description = gettext("Unbound Mithril Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.6;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -715,9 +715,9 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Spear");
|
||||
f->type = TT_SPEAR;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.4;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSpearRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SPEAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
||||
|
@ -729,8 +729,8 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_sword_copper.png^tool_binding_sword.png";
|
||||
f->description = gettext("Copper Sword");
|
||||
f->type = TT_SWORD;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSwordRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SWORD);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -742,9 +742,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_sword_bronze.png^tool_binding_sword.png";
|
||||
f->description = gettext("Bronze Sword");
|
||||
f->type = TT_SWORD;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSwordRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_SWORD);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -755,9 +755,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_sword_iron.png^tool_binding_sword.png";
|
||||
f->description = gettext("Iron Sword");
|
||||
f->type = TT_SWORD;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 3;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSwordRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SWORD);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -768,9 +768,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle.png^tool_head_sword_mithril.png^tool_binding_sword.png";
|
||||
f->description = gettext("Unbound Mithril Sword");
|
||||
f->type = TT_SWORD;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.6;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSwordRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SWORD);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -782,9 +782,9 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Sword");
|
||||
f->type = TT_SWORD;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.4;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setSwordRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SWORD);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
||||
|
@ -796,9 +796,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_flintshears.png";
|
||||
f->description = gettext("Flint Shears");
|
||||
f->type = TT_SHEAR;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setShearsRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSHEARS);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -809,9 +809,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_copper_shears.png";
|
||||
f->description = gettext("Copper Shears");
|
||||
f->type = TT_SHEAR;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setShearsRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_SHEARS);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -822,9 +822,9 @@ void content_toolitem_init()
|
|||
f->texture = "tool_ironshears.png";
|
||||
f->description = gettext("Iron Shears");
|
||||
f->type = TT_SHEAR;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setShearsRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_SHEARS);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -839,8 +839,8 @@ void content_toolitem_init()
|
|||
f->liquids_pointable = true;
|
||||
f->type = TT_BUCKET;
|
||||
f->param_type = CPT_CONTENT;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.uses = WOOD_BUCKET_USES;
|
||||
f->diginfo.time = WOOD_BUCKET_TIME;
|
||||
f->diginfo.level = 1;
|
||||
f->damaging_nodes_diggable = false;
|
||||
crafting::setURecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TOOLITEM_WBUCKET);
|
||||
|
@ -857,9 +857,9 @@ void content_toolitem_init()
|
|||
f->liquids_pointable = true;
|
||||
f->type = TT_BUCKET;
|
||||
f->param_type = CPT_CONTENT;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.75;
|
||||
f->diginfo.level = 2;
|
||||
f->diginfo.uses = TIN_BUCKET_USES;
|
||||
f->diginfo.time = TIN_BUCKET_TIME;
|
||||
f->diginfo.level = 1;
|
||||
f->damaging_nodes_diggable = false;
|
||||
crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -874,9 +874,9 @@ void content_toolitem_init()
|
|||
f->liquids_pointable = true;
|
||||
f->type = TT_BUCKET;
|
||||
f->param_type = CPT_CONTENT;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.level = 3;
|
||||
f->diginfo.uses = IRON_BUCKET_USES;
|
||||
f->diginfo.time = IRON_BUCKET_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setURecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_BUCKET);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
@ -891,47 +891,47 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle_short.png^tool_head_knife_stone.png";
|
||||
f->description = gettext("Stone Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 32;
|
||||
f->diginfo.time = 3.0;
|
||||
f->diginfo.uses = STONE_USES;
|
||||
f->diginfo.time = STONE_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_ROCK,CONTENT_TOOLITEM_STONE_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_KNIFE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_short.png^tool_head_knife_copper.png";
|
||||
f->description = gettext("Copper Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 2.0;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_FLINT_KNIFE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_short.png^tool_head_knife_flint.png";
|
||||
f->description = gettext("Flint Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 64;
|
||||
f->diginfo.time = 2.0;
|
||||
f->diginfo.uses = FLINT_USES;
|
||||
f->diginfo.time = FLINT_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINT_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_COPPER_KNIFE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_short.png^tool_head_knife_copper.png";
|
||||
f->description = gettext("Copper Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = COPPER_USES;
|
||||
f->diginfo.time = COPPER_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_TOOLITEM_COPPER_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
content_list_add("creative",i,1,0);
|
||||
|
||||
i = CONTENT_TOOLITEM_BRONZE_KNIFE;
|
||||
f = &g_content_toolitem_features[i];
|
||||
f->content = i;
|
||||
f->texture = "tool_handle_short.png^tool_head_knife_bronze.png";
|
||||
f->description = gettext("Bronze Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 128;
|
||||
f->diginfo.time = 1.5;
|
||||
f->diginfo.uses = BRONZE_USES;
|
||||
f->diginfo.time = BRONZE_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_BRONZE_INGOT,CONTENT_TOOLITEM_BRONZE_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -943,8 +943,8 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle_short.png^tool_head_knife_iron.png";
|
||||
f->description = gettext("Iron Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 256;
|
||||
f->diginfo.time = 1.0;
|
||||
f->diginfo.uses = IRON_USES;
|
||||
f->diginfo.time = IRON_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_IRON_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -956,8 +956,8 @@ void content_toolitem_init()
|
|||
f->texture = "tool_handle_short.png^tool_head_knife_mithril.png";
|
||||
f->description = gettext("Unbound Mithril Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->diginfo.uses = 1024;
|
||||
f->diginfo.time = 0.5;
|
||||
f->diginfo.uses = U_MITHRIL_USES;
|
||||
f->diginfo.time = U_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -970,8 +970,8 @@ void content_toolitem_init()
|
|||
f->description = gettext("Mithril Knife");
|
||||
f->type = TT_KNIFE;
|
||||
f->param_type = CPT_ENCHANTMENT;
|
||||
f->diginfo.uses = 2048;
|
||||
f->diginfo.time = 0.5;
|
||||
f->diginfo.uses = E_MITHRIL_USES;
|
||||
f->diginfo.time = E_MITHRIL_TIME;
|
||||
f->diginfo.level = 1;
|
||||
crafting::setKnifeRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_KNIFE);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -986,7 +986,7 @@ void content_toolitem_init()
|
|||
f->description = gettext("Fire Starter");
|
||||
f->liquids_pointable = true;
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.level = 3;
|
||||
f->diginfo.level = 1;
|
||||
f->has_fire_effect = true;
|
||||
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_FIRESTARTER);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -998,7 +998,7 @@ void content_toolitem_init()
|
|||
f->texture = "tool_crowbar.png";
|
||||
f->description = gettext("Crowbar");
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.level = 3;
|
||||
f->diginfo.level = 1;
|
||||
f->has_rotate_effect = true;
|
||||
crafting::set1over1Recipe(CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_CRAFTITEM_IRON_INGOT,CONTENT_TOOLITEM_CROWBAR);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -1010,7 +1010,7 @@ void content_toolitem_init()
|
|||
f->texture = "tool_key.png";
|
||||
f->description = gettext("Key");
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.level = 1;
|
||||
f->has_unlock_effect = true;
|
||||
crafting::set1To1Recipe(CONTENT_CRAFTITEM_GOLD_INGOT,CONTENT_TOOLITEM_KEY);
|
||||
content_list_add("craftguide",i,1,0);
|
||||
|
@ -1022,7 +1022,7 @@ void content_toolitem_init()
|
|||
f->texture = "tool_mithril_key.png";
|
||||
f->description = gettext("Mithril Key");
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.level = 5;
|
||||
f->diginfo.level = 1;
|
||||
f->has_unlock_effect = true;
|
||||
f->has_super_unlock_effect = true;
|
||||
/* this can only be crafted by server admin */
|
||||
|
@ -1041,7 +1041,7 @@ void content_toolitem_init()
|
|||
f->texture = "tool_mob_spawner.png";
|
||||
f->description = gettext("Mob Spawner");
|
||||
f->type = TT_SPECIAL;
|
||||
f->diginfo.level = 4;
|
||||
f->diginfo.level = 1;
|
||||
f->param_type = CPT_DROP;
|
||||
{
|
||||
content_t r[9] = {
|
||||
|
|
|
@ -177,4 +177,56 @@ ToolItemFeatures & content_toolitem_features(std::string subname);
|
|||
#define CONTENT_TOOLITEM_COPPER_SPEAR (CONTENT_TOOLITEM_MASK | 0x39)
|
||||
#define CONTENT_TOOLITEM_COPPER_SHEARS (CONTENT_TOOLITEM_MASK | 0x3A)
|
||||
|
||||
// times are calculated as :
|
||||
// Stone : 3.0
|
||||
// Flint : 3.0 - 1.0 = 2.0
|
||||
// Copper : 2.0 - 0.5 = 1.5
|
||||
// Bronze : 1.5 - 0.4 = 1.1
|
||||
// Iron : 1.1 - 0.3 = 0.8
|
||||
// Mithril : 0.8 - 0.2 = 0.6 Unbound
|
||||
// Mithril : 0.6 - 0.2 = 0.4 Enchanted
|
||||
#define STONE_USES 32
|
||||
#define STONE_TIME 3.0
|
||||
#define STONE_LEVEL 1
|
||||
|
||||
#define FLINT_USES 64
|
||||
#define FLINT_TIME 2.0
|
||||
#define FLINT_LEVEL 2
|
||||
|
||||
#define COPPER_USES 128
|
||||
#define COPPER_TIME 1.5
|
||||
#define COPPER_LEVEL 2
|
||||
|
||||
#define BRONZE_USES 256
|
||||
#define BRONZE_TIME 1.1
|
||||
#define BRONZE_LEVEL 3
|
||||
|
||||
#define IRON_USES 512
|
||||
#define IRON_TIME 0.8
|
||||
#define IRON_LEVEL 4
|
||||
|
||||
// Unbound Mithril
|
||||
#define U_MITHRIL_USES 1024
|
||||
#define U_MITHRIL_TIME 0.6
|
||||
#define U_MITHRIL_LEVEL 5
|
||||
|
||||
// Enchanted Mithril
|
||||
#define E_MITHRIL_USES 2048
|
||||
#define E_MITHRIL_TIME 0.4
|
||||
#define E_MITHRIL_LEVEL 5
|
||||
|
||||
#define BOW_USES 256
|
||||
#define BOW_TIME 1.0
|
||||
#define BOW_LEVEL 1
|
||||
|
||||
#define WOOD_BUCKET_USES 64
|
||||
#define WOOD_BUCKET_TIME 1.5
|
||||
|
||||
#define TIN_BUCKET_USES 128
|
||||
#define TIN_BUCKET_TIME 1.75
|
||||
|
||||
#define IRON_BUCKET_USES 256
|
||||
#define IRON_BUCKET_TIME 1.0
|
||||
|
||||
|
||||
#endif
|
||||
|
|
19
src/game.cpp
19
src/game.cpp
|
@ -53,6 +53,7 @@
|
|||
#include "main.h"
|
||||
#endif
|
||||
#include "hud.h"
|
||||
#include "tutorial.h"
|
||||
#include "sky.h"
|
||||
#include "selection_mesh.h"
|
||||
|
||||
|
@ -2300,6 +2301,24 @@ void the_game(
|
|||
client.getEnv().getTime()
|
||||
);
|
||||
}
|
||||
|
||||
// FIXME
|
||||
{
|
||||
core::dimension2d<u32> screensize = driver->getScreenSize();
|
||||
s32 x = (screensize.Width/2);
|
||||
s32 y = (screensize.Height/2);
|
||||
LocalPlayer* player = client.getLocalPlayer();
|
||||
Tutorial *tuto = player->tutorial;
|
||||
|
||||
if (input->isKeyDown(getKeySetting(tuto->getCurrentTutorialCompletionValue())))
|
||||
tuto->setCurrentTutorialToNext();
|
||||
|
||||
std::string tutotext = tuto->getCurrentTutorialText();
|
||||
std::wstring text = narrow_to_wide(tutotext);
|
||||
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
|
||||
core::rect<s32> rect((x-412)-(textsize.Width/2), y+10, (x-412)+(textsize.Width/2), y+10+textsize.Height);
|
||||
guienv->addStaticText(text.c_str(),rect);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -530,11 +530,13 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
|||
rect += topleft_content + v2s32(80, 210);
|
||||
Environment->addCheckBox(anisotropic, rect, this, GUI_ID_ANISOTROPIC_CB, narrow_to_wide(gettext("Anisotropic Filtering")).c_str());
|
||||
}
|
||||
/* TODO: make this not crash the game
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 200, 30);
|
||||
rect += topleft_content + v2s32(80, 240);
|
||||
Environment->addCheckBox(texture_animation, rect, this, GUI_ID_TEXTUREANIM_CB, narrow_to_wide(gettext("Enable Texture Animation")).c_str());
|
||||
}
|
||||
*/
|
||||
if (m_is_ingame) {
|
||||
core::rect<s32> rect(0, 0, 550, 20);
|
||||
rect += topleft_content + v2s32(0, 280);
|
||||
|
@ -713,11 +715,13 @@ bool GUISettingsMenu::acceptInput()
|
|||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
m_data.anisotropic_filter = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
/*
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_TEXTUREANIM_CB);
|
||||
if (e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
m_data.texture_animation = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
*/
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_HOTBAR_CB);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
|
|
|
@ -902,7 +902,7 @@ int main(int argc, char *argv[])
|
|||
uint16_t font_size = config_get_int("client.ui.font.size");
|
||||
char* v = config_get("client.ui.font");
|
||||
if (!v)
|
||||
v = "unifont.ttf";
|
||||
v = "arimo.ttf";
|
||||
if (path_get("font",v,1,buff,1024))
|
||||
font = gui::CGUITTFont::createTTFont(guienv, buff, font_size, true, true, 1, 128);
|
||||
#else
|
||||
|
|
|
@ -94,11 +94,14 @@ void init_mineral()
|
|||
f->texture = "mineral_coal.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_COAL;
|
||||
|
||||
i = MINERAL_IRON;
|
||||
// Flint from gravel for level 2 tools
|
||||
|
||||
i = MINERAL_COPPER;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Iron");
|
||||
f->texture = "mineral_iron.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_IRON;
|
||||
f->description = gettext("Copper");
|
||||
f->texture = "mineral_copper.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_COPPER;
|
||||
f->dug_count_max = 4;
|
||||
f->min_level = 2;
|
||||
|
||||
i = MINERAL_TIN;
|
||||
|
@ -108,13 +111,29 @@ void init_mineral()
|
|||
f->dug_item = CONTENT_CRAFTITEM_TIN;
|
||||
f->min_level = 2;
|
||||
|
||||
i = MINERAL_COPPER;
|
||||
// bronze for level 3 tools
|
||||
|
||||
i = MINERAL_IRON;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Copper");
|
||||
f->texture = "mineral_copper.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_COPPER;
|
||||
f->dug_count_max = 4;
|
||||
f->min_level = 2;
|
||||
f->description = gettext("Iron");
|
||||
f->texture = "mineral_iron.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_IRON;
|
||||
f->min_level = 3;
|
||||
|
||||
i = MINERAL_MITHRIL;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Mithril");
|
||||
f->texture = "mineral_mithril.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW;
|
||||
f->min_level = 4;
|
||||
|
||||
i = MINERAL_SALT;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Salt");
|
||||
f->texture = "mineral_salt.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_SALT;
|
||||
f->min_level = 1;
|
||||
f->dug_count_max = 2;
|
||||
|
||||
i = MINERAL_SILVER;
|
||||
f = &mineral_features(i);
|
||||
|
@ -137,13 +156,6 @@ void init_mineral()
|
|||
f->dug_item = CONTENT_CRAFTITEM_QUARTZ;
|
||||
f->min_level = 3;
|
||||
|
||||
i = MINERAL_MITHRIL;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Mithril");
|
||||
f->texture = "mineral_mithril.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW;
|
||||
f->min_level = 3;
|
||||
|
||||
i = MINERAL_RUBY;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Ruby");
|
||||
|
@ -183,12 +195,4 @@ void init_mineral()
|
|||
f->dug_item = CONTENT_CRAFTITEM_SUNSTONE;
|
||||
f->min_level = 3;
|
||||
f->dug_count_max = 2;
|
||||
|
||||
i = MINERAL_SALT;
|
||||
f = &mineral_features(i);
|
||||
f->description = gettext("Salt");
|
||||
f->texture = "mineral_salt.png";
|
||||
f->dug_item = CONTENT_CRAFTITEM_SALT;
|
||||
f->min_level = 1;
|
||||
f->dug_count_max = 2;
|
||||
}
|
||||
|
|
|
@ -76,28 +76,39 @@ std::vector<NodeBox> ClockNodeMetadata::getNodeBoxes(MapNode &n) {
|
|||
v[2] = m/10;
|
||||
v[3] = m%10;
|
||||
|
||||
f32 x[4] = {-0.125,0.0625,0.3125,0.5};
|
||||
f32 x[4] = {-0.180,0.0225,0.2925,0.5};
|
||||
|
||||
u8 b[10] = {0xFC,0x0C,0xB6,0x9E,0x4E,0xDA,0xFA,0x8C,0xFE,0xDE};
|
||||
|
||||
float z1 = -0.125;
|
||||
float z2 = -0.0625;
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
// clock numbers are built from 7 segments
|
||||
// top
|
||||
if ((b[v[i]]&0x80))
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,0.0625*BS,-0.125*BS,(-0.0625+x[i])*BS,0.125*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,0.0625*BS,z1*BS,(-0.0625+x[i])*BS,0.125*BS,z2*BS));
|
||||
// top right
|
||||
if ((b[v[i]]&0x04))
|
||||
boxes.push_back(NodeBox((-0.125+x[i])*BS,-0.0625*BS,-0.125*BS,(-0.0625+x[i])*BS,0.0625*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.125+x[i])*BS,-0.125*BS,z1*BS,(-0.0625+x[i])*BS,0.125*BS,z2*BS));
|
||||
// bottom right
|
||||
if ((b[v[i]]&0x08))
|
||||
boxes.push_back(NodeBox((-0.125+x[i])*BS,-0.25*BS,-0.125*BS,(-0.0625+x[i])*BS,-0.125*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.125+x[i])*BS,-0.3125*BS,z1*BS,(-0.0625+x[i])*BS,-0.0625*BS,z2*BS));
|
||||
// bottom
|
||||
if ((b[v[i]]&0x10))
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.3125*BS,-0.125*BS,(-0.0625+x[i])*BS,-0.25*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.3125*BS,z1*BS,(-0.0625+x[i])*BS,-0.25*BS,z2*BS));
|
||||
// bottom left
|
||||
if ((b[v[i]]&0x20))
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.25*BS,-0.125*BS,(-0.1875+x[i])*BS,-0.125*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.3125*BS,z1*BS,(-0.1875+x[i])*BS,-0.0625*BS,z2*BS));
|
||||
// top left
|
||||
if ((b[v[i]]&0x40))
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.0625*BS,-0.125*BS,(-0.1875+x[i])*BS,0.0625*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.125*BS,z1*BS,(-0.1875+x[i])*BS,0.125*BS,z2*BS));
|
||||
// middle
|
||||
if ((b[v[i]]&0x02))
|
||||
boxes.push_back(NodeBox((-0.1875+x[i])*BS,-0.125*BS,-0.125*BS,(-0.125+x[i])*BS,-0.0625*BS,-0.0625*BS));
|
||||
boxes.push_back(NodeBox((-0.25+x[i])*BS,-0.125*BS,z1*BS,(-0.0625+x[i])*BS,-0.0625*BS,z2*BS));
|
||||
}
|
||||
|
||||
return transformNodeBox(n,boxes);
|
||||
return boxes;
|
||||
}
|
||||
bool ClockNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
|
||||
{
|
||||
|
|
|
@ -136,8 +136,17 @@ bool CraftGuideNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env
|
|||
{
|
||||
InventoryList *l = m_inventory->getList("result");
|
||||
InventoryItem *t = l->getItem(0);
|
||||
if (!t || t->getContent() == CONTENT_IGNORE)
|
||||
|
||||
if (!t || t->getContent() == CONTENT_IGNORE){
|
||||
// nothing in result box so clear recipe list
|
||||
InventoryList *rec_list = m_inventory->getList("recipe");
|
||||
if (rec_list) {
|
||||
//clear out the recipe grid if the item slot is empty
|
||||
rec_list->clearItems();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
content_t *r = crafting::getRecipe(t,m_recipe);
|
||||
if (!r) {
|
||||
if (m_recipe == 0)
|
||||
|
@ -468,12 +477,24 @@ void ReverseCraftGuideNodeMetadata::inventoryModified()
|
|||
}
|
||||
bool ReverseCraftGuideNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
|
||||
{
|
||||
//make sure there's a valid item list
|
||||
InventoryList *item_list = m_inventory->getList("item");
|
||||
if (!item_list) return false;
|
||||
|
||||
//get the item in the item box
|
||||
InventoryItem *item = m_inventory->getList("item")->getItem(0);
|
||||
InventoryItem *item = item_list->getItem(0);
|
||||
|
||||
//if there's no item in the item box, do nothing
|
||||
if (!item || item->getContent() == CONTENT_IGNORE)
|
||||
return false;
|
||||
if (!item || item->getContent() == CONTENT_IGNORE) {
|
||||
// nothing in item box so clear recipe and result lists
|
||||
InventoryList *rec_list = m_inventory->getList("recipe");
|
||||
if (rec_list)
|
||||
rec_list->clearItems();
|
||||
InventoryList *res_list = m_inventory->getList("result");
|
||||
if (res_list)
|
||||
res_list->clearItems();
|
||||
return true;
|
||||
}
|
||||
|
||||
//attempt to look up the recipe
|
||||
crafting::FoundReverseRecipe recipe = crafting::getReverseRecipe(item, m_recipe);
|
||||
|
@ -731,8 +752,17 @@ bool CookBookNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
|
|||
{
|
||||
InventoryList *l = m_inventory->getList("result");
|
||||
InventoryItem *t = l->getItem(0);
|
||||
if (!t || t->getContent() == CONTENT_IGNORE)
|
||||
|
||||
if (!t || t->getContent() == CONTENT_IGNORE){
|
||||
// nothing in result box so clear recipe list
|
||||
InventoryList *rec_list = m_inventory->getList("recipe");
|
||||
if (rec_list) {
|
||||
//clear out the recipe grid if the item slot is empty
|
||||
rec_list->clearItems();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
InventoryItem *cookresult = t->createCookResult();
|
||||
if (!cookresult || cookresult->getContent() == CONTENT_IGNORE)
|
||||
return false;
|
||||
|
@ -992,16 +1022,29 @@ bool DeCraftNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
|
|||
{
|
||||
InventoryList *l = m_inventory->getList("result");
|
||||
InventoryItem *t = l->getItem(0);
|
||||
|
||||
int leave = 0;
|
||||
|
||||
if (!t || t->getContent() == CONTENT_IGNORE)
|
||||
return false;
|
||||
if ((t->getContent()&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK)
|
||||
return false;
|
||||
if ((t->getContent()&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK)
|
||||
return false;
|
||||
if ((t->getContent()&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK)
|
||||
return false;
|
||||
if (content_features(t->getContent()).dug_item == "" && content_features(t->getContent()).extra_dug_item == "")
|
||||
return false;
|
||||
leave=1;
|
||||
else if ((t->getContent()&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK)
|
||||
leave=1;
|
||||
else if ((t->getContent()&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK)
|
||||
leave=1;
|
||||
else if ((t->getContent()&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK)
|
||||
leave=1;
|
||||
else if (content_features(t->getContent()).dug_item == "" && content_features(t->getContent()).extra_dug_item == "")
|
||||
leave=1;
|
||||
if (leave) {
|
||||
// nothing in item box so clear recipe and result lists
|
||||
InventoryList *rec_list = m_inventory->getList("recipe");
|
||||
if (rec_list)
|
||||
rec_list->clearItems();
|
||||
InventoryList *ran_list = m_inventory->getList("random");
|
||||
if (ran_list)
|
||||
ran_list->clearItems();
|
||||
return true;
|
||||
}
|
||||
l = m_inventory->getList("recipe");
|
||||
l->clearItems();
|
||||
if (content_features(t->getContent()).dug_item != "") {
|
||||
|
|
|
@ -127,7 +127,7 @@ std::vector<NodeBox> BookShelfNodeMetadata::getNodeBoxes(MapNode &n)
|
|||
));
|
||||
}
|
||||
|
||||
return transformNodeBox(n,boxes);
|
||||
return boxes;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
18
src/path.c
18
src/path.c
|
@ -40,15 +40,15 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
static struct {
|
||||
char* cwd; /* current working directory */
|
||||
char* data_custom; /* set by config data_path */
|
||||
char* data_user; /* ~/.local/share/voxelands */
|
||||
char* data_global; /* /usr/share/voxelands */
|
||||
char* data; /* ./data if it exists */
|
||||
char* world; /* data_user + /worlds/ + world name */
|
||||
char* home; /* ~/. */
|
||||
char* config; /* ~/.config/voxelands */
|
||||
char* screenshot; /* set by config screenshot_path */
|
||||
char* cwd; // current working directory
|
||||
char* data_custom; // set by config data_path
|
||||
char* data_user; // ~/.local/share/voxelands
|
||||
char* data_global; // /usr/share/voxelands
|
||||
char* data; // ./data if it exists
|
||||
char* world; // data_user + /worlds/ + world name
|
||||
char* home; // ~/.
|
||||
char* config; // ~/.config/voxelands
|
||||
char* screenshot; // set by config screenshot_path
|
||||
} path = {
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
|
@ -72,7 +72,8 @@ Player::Player():
|
|||
m_home(0,0,0),
|
||||
m_hashome(false),
|
||||
m_character(PLAYER_DEFAULT_CHARDEF),
|
||||
m_given_clothes(false)
|
||||
m_given_clothes(false),
|
||||
tutorial(new Tutorial())
|
||||
{
|
||||
updateName("<not set>");
|
||||
for (u8 i=0; i<PLAYERFLAG_COUNT; i++) {
|
||||
|
@ -1308,4 +1309,3 @@ video::ITexture* LocalPlayer::getTexture()
|
|||
return g_texturesource->getTextureRaw(tex);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#endif
|
||||
#include "inventory.h"
|
||||
#include "collision.h"
|
||||
#include "tutorial.h"
|
||||
|
||||
#define PLAYERNAME_SIZE 20
|
||||
|
||||
|
@ -391,6 +392,8 @@ public:
|
|||
// the unclothed player skin parts
|
||||
void getSkin(std::vector<std::string> &parts);
|
||||
|
||||
Tutorial *tutorial;
|
||||
|
||||
protected:
|
||||
char m_name[PLAYERNAME_SIZE];
|
||||
u16 m_selected_item;
|
||||
|
@ -683,4 +686,3 @@ private:
|
|||
#endif // !SERVER
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1793,7 +1793,7 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
|
|||
gui::IGUIFont *std_font = skin->getFont();
|
||||
static gui::IGUIFont *tex_font = NULL;
|
||||
#if USE_FREETYPE
|
||||
if (path_get("font","unifont.ttf",1,buff,1024)) {
|
||||
if (path_get("font","arimo.ttf",1,buff,1024)) {
|
||||
int sz = 10*((dim.Width/16)+1);
|
||||
if (sz < 10)
|
||||
sz = 12;
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
/************************************************************************
|
||||
* Minetest-c55
|
||||
* Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
*
|
||||
* tutorial.h
|
||||
* voxelands - 3d voxel world sandbox game
|
||||
* Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
|
||||
* for Voxelands.
|
||||
*
|
||||
* Created by Futuray
|
||||
************************************************************************/
|
||||
|
||||
#include "tutorial.h"
|
||||
|
||||
Tutorial::Tutorial():
|
||||
currentTutorial(0)
|
||||
{
|
||||
};
|
||||
|
||||
Tutorial::Tutorial(int current):
|
||||
currentTutorial(current)
|
||||
{
|
||||
};
|
||||
|
||||
Tutorial::~Tutorial()
|
||||
{
|
||||
};
|
||||
|
||||
std::string Tutorial::getText(int num)
|
||||
{
|
||||
switch(num) // TODO : translations
|
||||
{
|
||||
case TUTORIAL_WALK :
|
||||
return (std::string)"Press the [W] button to walk forward.";
|
||||
|
||||
case TUTORIAL_JUMP :
|
||||
return (std::string)"Press the spacebar to jump.";
|
||||
|
||||
/* case TUTORIAL_LOOK :
|
||||
return (std::string)"Move the mouse to look around you."; */
|
||||
|
||||
case TUTORIAL_INVENTORY :
|
||||
return (std::string)"Press the [I] button to open your inventory\nand the [Q] button to interact with nodes.";
|
||||
|
||||
/*case TUTORIAL_DIG_PLACE :
|
||||
return (std::string)"Use the left click to dig nodes and the right click to place them.";*/
|
||||
|
||||
case TUTORIAL_EAT :
|
||||
return (std::string)"Use the [H] button to eat any food.";
|
||||
|
||||
default :
|
||||
return (std::string)"Tutorial is done!";
|
||||
};
|
||||
}
|
||||
|
||||
void Tutorial::setCurrentTutorialToNext()
|
||||
{
|
||||
this->currentTutorial++;
|
||||
}
|
||||
|
||||
void Tutorial::setCurrentTutorialToNumber(int number)
|
||||
{
|
||||
this->currentTutorial = number;
|
||||
}
|
||||
|
||||
int Tutorial::getCurrentTutorialNumber()
|
||||
{
|
||||
return this->currentTutorial;
|
||||
}
|
||||
|
||||
int Tutorial::getCurrentTutorialCompletionValue()
|
||||
{
|
||||
switch(this->currentTutorial)
|
||||
{
|
||||
case TUTORIAL_WALK :
|
||||
return TUTORIAL_KEY_WALK;
|
||||
|
||||
case TUTORIAL_JUMP :
|
||||
return TUTORIAL_KEY_JUMP;
|
||||
|
||||
/* case TUTORIAL_LOOK :
|
||||
return (std::string)"Move the mouse to look around you."; */
|
||||
|
||||
case TUTORIAL_INVENTORY :
|
||||
return TUTORIAL_KEY_INVENTORY;
|
||||
|
||||
/*case TUTORIAL_DIG_PLACE :
|
||||
return (std::string)"Use the left click to dig nodes and the right click to place them.";*/
|
||||
|
||||
case TUTORIAL_EAT :
|
||||
return TUTORIAL_KEY_EAT;
|
||||
|
||||
default :
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
std::string Tutorial::getCurrentTutorialText()
|
||||
{
|
||||
return this->getText(this->currentTutorial);
|
||||
}
|
||||
|
||||
std::string Tutorial::getNumberText(int number)
|
||||
{
|
||||
return this->getText(number);
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/************************************************************************
|
||||
* Minetest-c55
|
||||
* Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
*
|
||||
* tutorial.h
|
||||
* voxelands - 3d voxel world sandbox game
|
||||
* Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
|
||||
* for Voxelands.
|
||||
*
|
||||
* Created by Futuray
|
||||
************************************************************************/
|
||||
|
||||
/* 2304
|
||||
{
|
||||
vlprintf(CN_INFO,"Tuto Begin");
|
||||
core::dimension2d<u32> screensize = driver->getScreenSize();
|
||||
s32 x = (screensize.Width/2);
|
||||
s32 y = (screensize.Height/2);
|
||||
LocalPlayer* player = client.getLocalPlayer();
|
||||
Tutorial *tuto = player->tutorial;
|
||||
std::string tutotext = tuto->getCurrentTutorialText();
|
||||
std::wstring text = narrow_to_wide(tutotext);
|
||||
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
|
||||
core::rect<s32> rect((x-412)-(textsize.Width/2), y+10, (x-412)+(textsize.Width/2), y+10+textsize.Height);
|
||||
guienv->addStaticText(text.c_str(),rect);
|
||||
vlprintf(CN_INFO,"Tuto OK"); //chatline_add(&chat_lines,narrow_to_wide(gettext("HUD shown")),-103.00);
|
||||
}
|
||||
*/
|
||||
|
||||
// 395 [player.h]
|
||||
// #include "tutorial.h"
|
||||
// Tutorial *tutorial;
|
||||
|
||||
// 76 [player.cpp]
|
||||
// tutorial(new Tutorial())
|
||||
|
||||
#ifndef TUTORIAL_HEADER
|
||||
#define TUTORIAL_HEADER
|
||||
|
||||
#include "log.h"
|
||||
#include "common.h"
|
||||
#include "keycode.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#define TUTORIAL_WALK 0
|
||||
#define TUTORIAL_JUMP 1
|
||||
// #define TUTORIAL_LOOK 2 # FIXME : find a way to check if the player look around
|
||||
#define TUTORIAL_INVENTORY 2
|
||||
// #define TUTORIAL_DIG_PLACE 3 # FIXME : find a way to check if the player push Leftclick
|
||||
#define TUTORIAL_EAT 3
|
||||
|
||||
#define TUTORIAL_KEY_WALK VLKC_FORWARD
|
||||
#define TUTORIAL_KEY_JUMP VLKC_JUMP
|
||||
// #define TUTORIAL_KEY_LOOK ???
|
||||
#define TUTORIAL_KEY_INVENTORY VLKC_INVENTORY
|
||||
// #define TUTORIAL_KEY_DIG_PLACE VLKC_FORWARD
|
||||
#define TUTORIAL_KEY_EAT VLKC_USE
|
||||
|
||||
class Tutorial
|
||||
{
|
||||
public:
|
||||
|
||||
Tutorial();
|
||||
Tutorial(int current);
|
||||
virtual ~Tutorial();
|
||||
|
||||
std::string getText(int num);
|
||||
void setCurrentTutorialToNext();
|
||||
void setCurrentTutorialToNumber(int number);
|
||||
int getCurrentTutorialNumber();
|
||||
int getCurrentTutorialCompletionValue();
|
||||
std::string getCurrentTutorialText();
|
||||
std::string getNumberText(int number);
|
||||
|
||||
int currentTutorial;
|
||||
};
|
||||
#endif
|
Loading…
Reference in New Issue