diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile index 949ac7d59df..2b96fc70e58 100644 --- a/crawl-ref/source/Makefile +++ b/crawl-ref/source/Makefile @@ -18,7 +18,8 @@ # Typical parameters: # TILES -- set to anything to enable tiles build # -# SOUND -- set to anything to enable sound +# SOUND -- set to anything to enable sound; note that you will need to +# uncomment some lines in sound.h if not building tiles # # CROSSHOST -- target system, eg, i386-pc-msdosdjgpp or i586-mingw32msvc # @@ -104,7 +105,7 @@ include Makefile.obj # # Which C++ standard to support -STDFLAG = -std=c++0x +STDFLAG = -std=c++11 CFOTHERS := -pipe $(EXTERNAL_FLAGS) CFWARN := @@ -132,7 +133,7 @@ CHMOD = chmod 2>/dev/null CHOWN = chown 2>/dev/null PNGCRUSH = $(COPY) PNGCRUSH_LABEL = COPY -ADVPNG = advpng -z -4 +ADVPNG = advpng -z -2 PKGCONFIG = pkg-config DOXYGEN = doxygen DOXYGEN_SIMPLE_CONF = crawl_simple.doxy @@ -227,7 +228,7 @@ ifeq ($(uname_S),Darwin) BUILD_SQLITE = YesPlease BUILD_ZLIB = YesPlease ifdef TILES - EXTRA_LIBS += -framework AppKit -framework AudioUnit -framework CoreAudio -framework ForceFeedback -framework Carbon -framework IOKit -framework OpenGL contrib/install/$(ARCH)/lib/libSDL2main.a + EXTRA_LIBS += -framework AppKit -framework AudioUnit -framework CoreAudio -framework ForceFeedback -framework Carbon -framework IOKit -framework OpenGL -framework AudioToolbox -framework CoreVideo contrib/install/$(ARCH)/lib/libSDL2main.a BUILD_FREETYPE = YesPlease BUILD_SDL2 = YesPlease BUILD_SDL2IMAGE = YesPlease @@ -285,7 +286,13 @@ endif LIBZ := contrib/install/$(ARCH)/lib/libz.a ifndef CROSSHOST - SQLITE_INCLUDE_DIR := /usr/include + # FreeBSD keeps all of its userland includes in /usr/local so + # look there + ifeq ($(uname_S),FreeBSD) + SQLITE_INCLUDE_DIR := /usr/local/include + else + SQLITE_INCLUDE_DIR := /usr/include + endif else # This is totally wrong, works only with some old-style setups, and # on some architectures of Debian/new FHS multiarch -- excluding, for @@ -323,10 +330,10 @@ endif # # Check for an Apple-released compiler. # -ifndef NO_APPLE_GCC +ifndef NO_APPLE_PLATFORM ifeq ($(uname_S),Darwin) ifneq ($(shell gcc -v 2>&1 | grep Apple),) -APPLE_GCC = YesPlease +APPLE_PLATFORM = YesPlease endif endif endif @@ -370,9 +377,6 @@ MCHMOD_LOGS := 664 INSTALL_UGRP := games:games endif -chroot_prefix := -prefix := - ifeq ($(patsubst %/local,%,$(patsubst %/,%,$(prefix))),/usr) FHS := yes endif @@ -405,73 +409,7 @@ endif INCLUDES_L += -Iutil -I. -ifdef APPLE_GCC - -MARCH := $(uname_M) - - -ifndef NO_AUTO_SDK - -# The SDK locations were moved in 10.8; this snippet tries to find them -# there first, then reverts to the original location. -XCODE_SDK_SUFFIX := Platforms/MacOSX.platform/Developer -# Try to use xcode-select -p to find the current user-configured Xcode.app. -XCODE_SELECT_PATH := $(shell xcode-select -p 2>/dev/null | sed 's/\/$$//') -ifeq ($(shell test -e "$(XCODE_SELECT_PATH)/$(XCODE_SDK_SUFFIX)" || echo NOPE),) -DEVELOPER_PATH := $(XCODE_SELECT_PATH)/$(XCODE_SDK_SUFFIX) -else -# Otherwise, try /Applications/Xcode.app. -XCODE_DEFAULT_PATH := /Applications/Xcode.app/Contents/Developer -ifeq ($(shell test -e "$(XCODE_DEFAULT_PATH)/$(XCODE_SDK_SUFFIX)" || echo NOPE),) -DEVELOPER_PATH := $(XCODE_DEFAULT_PATH)/$(XCODE_SDK_SUFFIX) -else -# If all else fails, maybe it's in /Developer. -DEVELOPER_PATH := /Developer -endif -endif - -# Find the oldest SDK available, in attempt to make this build as -# backward-compatible as we possibly can. -SDK_VER := $(shell command ls $(DEVELOPER_PATH)/SDKs | grep -v "MacOSX.sdk" | sort -n | head -1 | perl -pe 's/^MacOSX//g;s/.sdk$$//g') - -ifeq ($(SDK_VER),10.4u) -SDK_VER := 10.4 -endif - -ifndef SDK_VER -$(error You do not seem to have any Mac OS X SDKs installed! This build is doomed to fail) -endif - -endif - -ifndef SDK_VER -ifeq ($(MARCH),ppc) -SDK_VER := 10.4 -endif -ifeq ($(MARCH),i386) -SDK_VER := 10.4 -endif -ifeq ($(MARCH),x86_64) -ifdef TILES -SDK_VER := 10.6 -else -SDK_VER := 10.5 -endif -endif -endif - -# Mac OS X 10.4 adds a 'u' on the end of the SDK name. Everything -# else is much easier to predict the name of. -ifeq ($(SDK_VER),10.4) -GCC_VER := 4.0 -SDKROOT := $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VER)u.sdk -else -SDKROOT := $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VER).sdk -endif - -ifneq ($(shell test -d $(SDKROOT) || echo NOPE),) -$(error The Mac OS X $(SDK_VER) SDK seems missing) -endif +ifdef APPLE_PLATFORM ifdef BUILD_UNIVERSAL # [ds] 10.4 SDK g++-4.0 + x86_64 runs into SDL compile issues. @@ -479,13 +417,14 @@ CFLAGS_ARCH := -arch i386 -arch ppc -faltivec CFLAGS_DEPCC_ARCH := -arch i386 NO_INLINE_DEPGEN := YesPlease else -CFLAGS_ARCH := -arch $(MARCH) +CFLAGS_ARCH := -arch $(uname_M) endif -CC = $(GCC) $(CFLAGS_ARCH) -isysroot $(SDKROOT) -mmacosx-version-min=$(SDK_VER) -CXX = $(GXX) $(CFLAGS_ARCH) -isysroot $(SDKROOT) -mmacosx-version-min=$(SDK_VER) -DEPCC = $(GCC) $(or $(CFLAGS_DEPCC_ARCH),$(CFLAGS_ARCH)) -isysroot $(SDKROOT) -mmacosx-version-min=$(SDK_VER) -DEPCXX = $(GXX) $(or $(CFLAGS_DEPCC_ARCH),$(CFLAGS_ARCH)) -isysroot $(SDKROOT) -mmacosx-version-min=$(SDK_VER) +MACOSX_MIN_VERSION=10.7 +CC = $(GCC) $(CFLAGS_ARCH) -mmacosx-version-min=$(MACOSX_MIN_VERSION) +CXX = $(GXX) $(CFLAGS_ARCH) -stdlib=libc++ -mmacosx-version-min=$(MACOSX_MIN_VERSION) +DEPCC = $(GCC) $(or $(CFLAGS_DEPCC_ARCH),$(CFLAGS_ARCH)) -mmacosx-version-min=$(MACOSX_MIN_VERSION) +DEPCXX = $(GXX) $(or $(CFLAGS_DEPCC_ARCH),$(CFLAGS_ARCH)) -stdlib=libc++ -mmacosx-version-min=$(MACOSX_MIN_VERSION) ifdef USE_ICC CC += -gcc-name=gcc-$(GCC_VER) -gxx-name=g++-$(GCC_VER) @@ -760,10 +699,10 @@ endif # pkg-config ifndef GLES ifneq ($(uname_S),Darwin) -ifeq (,$(findstring MINGW,$(uname_S))) -LIBS += -lGL -lGLU -else +ifeq ($(msys),Yes) LIBS += -lopengl32 -lglu32 +else +LIBS += -lGL -lGLU endif endif endif @@ -782,6 +721,9 @@ CFWARN_L += $(shell w=-Wno-array-bounds;echo|$(GXX) -E -x c++ - -Werror $$w >/de CFWARN_L += $(shell w=-Wno-format-zero-length;echo|$(GXX) -E -x c++ - -Werror $$w >/dev/null 2>&1 && echo $$w) CFWARN_L += $(shell w=-Wmissing-declarations;echo|$(GXX) -E -x c++ - -Werror $$w >/dev/null 2>&1 && echo $$w) CFWARN_L += $(shell w=-Wredundant-decls;echo|$(GXX) -E -x c++ - -Werror $$w >/dev/null 2>&1 && echo $$w) +# Avoid warnings about safety checks that might be necessary on other compilers +# where the same enum is assigned a signed underlying type. +CFWARN_L += $(shell w=-Wno-tautological-unsigned-enum-zero-compare;echo|$(GXX) -E -x c++ - -Werror $$w >/dev/null 2>&1 && echo $$w) CFWARN_L += -Wno-parentheses -Wwrite-strings -Wshadow -pedantic CFOTHERS_L = $(EXTERNAL_FLAGS_L) $(EXTRA_FLAGS) $(DEFINES) $(SDL2_CFLAGS) @@ -1079,7 +1021,7 @@ ifeq ($(strip $(YACC)),) NO_YACC = YesPlease endif -ifneq ($(findstring $(MAKEFLAGS),s),s) +ifneq ($(findstring s,$(MAKEFLAGS)),s) ifndef V QUIET_CC = @echo ' ' CC $@; QUIET_CXX = @echo ' ' CXX $@; @@ -1203,6 +1145,10 @@ MAJOR_VERSION = $(shell echo "$(SRC_VERSION)"|sed -r 's/-.*//;s/^([^.]+\.[^.]+). export SRC_VERSION +# Update .ver file if SRC_VERSION has changed +.ver: FORCE + @echo '$(SRC_VERSION)' | cmp -s - $@ || echo '$(SRC_VERSION)' > $@ + PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION) SRC_PKG_TAR := $(PKG_SRC_DIR).tar.xz SRC_PKG_TAR_NODEPS := $(PKG_SRC_DIR)-nodeps.tar.xz @@ -1333,7 +1279,7 @@ endif compflag.h: $(OBJECTS:.o=.cc) main.cc util/gen-cflg.pl .cflags $(QUIET_GEN)util/gen-cflg.pl compflag.h "$(ALL_CFLAGS)" "$(LDFLAGS)" "$(HOST)" "$(ARCH)" -build.h: $(OBJECTS:.o=.cc) main.cc util/gen_ver.pl +build.h: $(OBJECTS:.o=.cc) main.cc util/gen_ver.pl .ver $(QUIET_GEN)util/gen_ver.pl $@ $(MERGE_BASE) version.o: build.h compflag.h @@ -1345,6 +1291,10 @@ $(DOC_BASE)/aptitudes.txt: $(DOC_TEMPLATES)/apt-tmpl.txt species-data.h aptitude util/gen-apt.pl $(QUIET_GEN)./util/gen-apt.pl $@ $^ +$(DOC_BASE)/aptitudes-wide.txt: $(DOC_TEMPLATES)/apt-tmpl-wide.txt species-data.h \ + aptitudes.h util/gen-apt.pl + $(QUIET_GEN)./util/gen-apt.pl $@ $^ + $(DOC_BASE)/FAQ.html: dat/database/FAQ.txt util/FAQ2html.pl $(QUIET_GEN)./util/FAQ2html.pl $< $@ @@ -1429,7 +1379,7 @@ endif $(COPY_R) dat/dlua/* $(datadir_fp)/dat/dlua/ echo "-- Autogenerated list of maps to load and compile:" \ >$(datadir_fp)/dat/dlua/loadmaps.lua - find dat -name '*.des'|sed s:dat/::| \ + find dat -name '*.des'|LC_ALL=C sort|sed s:dat/::| \ while read x; \ do echo "dgn.load_des_file('$$x')"; \ done >>$(datadir_fp)/dat/dlua/loadmaps.lua @@ -1445,7 +1395,7 @@ endif $(COPY) ../docs/develop/levels/*.txt $(datadir_fp)/docs/develop/levels/ $(COPY) ../docs/license/*.txt $(datadir_fp)/docs/license/ $(COPY) ../CREDITS.txt $(datadir_fp)/docs/ - $(COPY) ../settings/* $(datadir_fp)/settings/ + $(COPY_R) ../settings/* $(datadir_fp)/settings/ ifeq ($(GAME),crawl.exe) sed -i 's/$$/\r/' `find $(datadir_fp) -iname '*.txt' -o -iname '*.des'` endif diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc index a5068a4ae12..5f182444bb0 100644 --- a/crawl-ref/source/acquire.cc +++ b/crawl-ref/source/acquire.cc @@ -356,7 +356,7 @@ static skill_type _acquirement_weapon_skill(bool divine) { // reservoir sample. int count = 0; - skill_type skill = SK_FIGHTING; + skill_type skill = SK_UNARMED_COMBAT; for (skill_type sk = SK_FIRST_WEAPON; sk <= SK_LAST_WEAPON; ++sk) { // Adding a small constant allows for the occasional @@ -554,7 +554,7 @@ static int _acquirement_staff_subtype(bool /*divine*/, int & /*quantity*/) */ static int _acquirement_misc_subtype(bool /*divine*/, int & /*quantity*/) { - // Give a crystal ball based on both evocations and either best spell + // Give a crystal ball based on both evocations and either best spell // school or invocations if we haven't seen one. const skill_type best_spell_skill = best_magic_skill(); int skills = _skill_rdiv(SK_EVOCATIONS) @@ -908,7 +908,7 @@ static bool _do_book_acquirement(item_def &book, int agent) break; } } // switch book choice - + // If we couldn't make a useful book, try to make a manual instead. // We have to temporarily identify the book for this. int oldflags = book.flags; diff --git a/crawl-ref/source/aptitudes.h b/crawl-ref/source/aptitudes.h index 80d8ffa5d71..3d2e8e5b320 100644 --- a/crawl-ref/source/aptitudes.h +++ b/crawl-ref/source/aptitudes.h @@ -13,7 +13,7 @@ static inline species_skill_aptitude APT(species_type sp, static const species_skill_aptitude species_skill_aptitudes[] = { // SP_HUMAN - APT(SP_HUMAN, SK_FIGHTING, 0), + APT(SP_HUMAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_HUMAN, SK_SHORT_BLADES, 0), APT(SP_HUMAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_HUMAN, SK_AXES, 0), @@ -55,7 +55,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_HIGH_ELF - APT(SP_HIGH_ELF, SK_FIGHTING, 0), + APT(SP_HIGH_ELF, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_HIGH_ELF, SK_SHORT_BLADES, 2), APT(SP_HIGH_ELF, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_HIGH_ELF, SK_AXES, -2), @@ -91,7 +91,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_DEEP_ELF - APT(SP_DEEP_ELF, SK_FIGHTING, -2), + APT(SP_DEEP_ELF, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_DEEP_ELF, SK_SHORT_BLADES, 0), APT(SP_DEEP_ELF, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_DEEP_ELF, SK_AXES, -2), @@ -133,7 +133,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_SLUDGE_ELF - APT(SP_SLUDGE_ELF, SK_FIGHTING, 1), + APT(SP_SLUDGE_ELF, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_SLUDGE_ELF, SK_SHORT_BLADES, -1), APT(SP_SLUDGE_ELF, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_SLUDGE_ELF, SK_AXES, -2), @@ -169,7 +169,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = // SP_HALFLING - APT(SP_HALFLING, SK_FIGHTING, -1), + APT(SP_HALFLING, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_HALFLING, SK_SHORT_BLADES, 2), APT(SP_HALFLING, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_HALFLING, SK_AXES, 0), @@ -207,7 +207,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_HILL_ORC - APT(SP_HILL_ORC, SK_FIGHTING, 2), + APT(SP_HILL_ORC, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_HILL_ORC, SK_SHORT_BLADES, 0), APT(SP_HILL_ORC, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_HILL_ORC, SK_AXES, 3), @@ -243,7 +243,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_MOUNTAIN_DWARF - APT(SP_MOUNTAIN_DWARF, SK_FIGHTING, 2), + APT(SP_MOUNTAIN_DWARF, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_MOUNTAIN_DWARF, SK_SHORT_BLADES, 0), APT(SP_MOUNTAIN_DWARF, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_MOUNTAIN_DWARF, SK_AXES, 2), @@ -284,7 +284,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_MOUNTAIN_DWARF, SK_EVOCATIONS, 0), // SP_KOBOLD - APT(SP_KOBOLD, SK_FIGHTING, 3), + APT(SP_KOBOLD, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_KOBOLD, SK_SHORT_BLADES, 3), APT(SP_KOBOLD, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_KOBOLD, SK_AXES, 3), @@ -325,7 +325,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_KOBOLD, SK_EVOCATIONS, 4), // SP_MUMMY - APT(SP_MUMMY, SK_FIGHTING, 0), + APT(SP_MUMMY, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_MUMMY, SK_SHORT_BLADES, -2), APT(SP_MUMMY, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_MUMMY, SK_AXES, -2), @@ -366,7 +366,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_MUMMY, SK_EVOCATIONS, -2), // SP_NAGA - APT(SP_NAGA, SK_FIGHTING, 0), + APT(SP_NAGA, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_NAGA, SK_SHORT_BLADES, 0), APT(SP_NAGA, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_NAGA, SK_AXES, 0), @@ -407,7 +407,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_NAGA, SK_EVOCATIONS, 0), // SP_OGRE - APT(SP_OGRE, SK_FIGHTING, 3), + APT(SP_OGRE, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_OGRE, SK_SHORT_BLADES, -3), APT(SP_OGRE, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_OGRE, SK_AXES, -3), @@ -448,7 +448,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_OGRE, SK_EVOCATIONS, -2), // SP_TROLL - APT(SP_TROLL, SK_FIGHTING, -2), + APT(SP_TROLL, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_TROLL, SK_SHORT_BLADES, -2), APT(SP_TROLL, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_TROLL, SK_AXES, -2), @@ -489,7 +489,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_TROLL, SK_EVOCATIONS, -3), // SP_RED_DRACONIAN - APT(SP_RED_DRACONIAN, SK_FIGHTING, 1), + APT(SP_RED_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_RED_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_RED_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_RED_DRACONIAN, SK_AXES, 0), @@ -530,7 +530,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_RED_DRACONIAN, SK_EVOCATIONS, 0), // SP_WHITE_DRACONIAN - APT(SP_WHITE_DRACONIAN, SK_FIGHTING, 1), + APT(SP_WHITE_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_WHITE_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_WHITE_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_WHITE_DRACONIAN, SK_AXES, 0), @@ -571,7 +571,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_WHITE_DRACONIAN, SK_EVOCATIONS, 0), // SP_GREEN_DRACONIAN - APT(SP_GREEN_DRACONIAN, SK_FIGHTING, 1), + APT(SP_GREEN_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_GREEN_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_GREEN_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_GREEN_DRACONIAN, SK_AXES, 0), @@ -612,7 +612,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_GREEN_DRACONIAN, SK_EVOCATIONS, 0), // SP_YELLOW_DRACONIAN - APT(SP_YELLOW_DRACONIAN,SK_FIGHTING, 1), + APT(SP_YELLOW_DRACONIAN,SK_FIGHTING, UNUSABLE_SKILL), APT(SP_YELLOW_DRACONIAN,SK_SHORT_BLADES, 0), APT(SP_YELLOW_DRACONIAN,SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_YELLOW_DRACONIAN,SK_AXES, 0), @@ -653,7 +653,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_YELLOW_DRACONIAN,SK_EVOCATIONS, 0), // SP_GREY_DRACONIAN - APT(SP_GREY_DRACONIAN, SK_FIGHTING, 1), + APT(SP_GREY_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_GREY_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_GREY_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_GREY_DRACONIAN, SK_AXES, 0), @@ -694,7 +694,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_GREY_DRACONIAN, SK_EVOCATIONS, 0), // SP_BLACK_DRACONIAN - APT(SP_BLACK_DRACONIAN, SK_FIGHTING, 1), + APT(SP_BLACK_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_BLACK_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_BLACK_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_BLACK_DRACONIAN, SK_AXES, 0), @@ -735,7 +735,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_BLACK_DRACONIAN, SK_EVOCATIONS, 0), // SP_PURPLE_DRACONIAN - APT(SP_PURPLE_DRACONIAN,SK_FIGHTING, 1), + APT(SP_PURPLE_DRACONIAN,SK_FIGHTING, UNUSABLE_SKILL), APT(SP_PURPLE_DRACONIAN,SK_SHORT_BLADES, 0), APT(SP_PURPLE_DRACONIAN,SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_PURPLE_DRACONIAN,SK_AXES, 0), @@ -777,7 +777,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_MOTTLED_DRACONIAN - APT(SP_MOTTLED_DRACONIAN,SK_FIGHTING, 1), + APT(SP_MOTTLED_DRACONIAN,SK_FIGHTING, UNUSABLE_SKILL), APT(SP_MOTTLED_DRACONIAN,SK_SHORT_BLADES, 0), APT(SP_MOTTLED_DRACONIAN,SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_MOTTLED_DRACONIAN,SK_AXES, 0), @@ -813,7 +813,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_PALE_DRACONIAN - APT(SP_PALE_DRACONIAN, SK_FIGHTING, 1), + APT(SP_PALE_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_PALE_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_PALE_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_PALE_DRACONIAN, SK_AXES, 0), @@ -854,7 +854,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_PALE_DRACONIAN, SK_EVOCATIONS, 1), // SP_BASE_DRACONIAN - APT(SP_BASE_DRACONIAN, SK_FIGHTING, 1), + APT(SP_BASE_DRACONIAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_BASE_DRACONIAN, SK_SHORT_BLADES, 0), APT(SP_BASE_DRACONIAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_BASE_DRACONIAN, SK_AXES, 0), @@ -895,7 +895,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_BASE_DRACONIAN, SK_EVOCATIONS, 0), #if TAG_MAJOR_VERSION == 34 - APT(SP_CENTAUR, SK_FIGHTING, 0), + APT(SP_CENTAUR, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_CENTAUR, SK_SHORT_BLADES, -1), APT(SP_CENTAUR, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_CENTAUR, SK_AXES, -1), @@ -931,7 +931,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_DEMIGOD - APT(SP_DEMIGOD, SK_FIGHTING, -1), + APT(SP_DEMIGOD, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_DEMIGOD, SK_SHORT_BLADES, -1), APT(SP_DEMIGOD, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_DEMIGOD, SK_AXES, -1), @@ -970,9 +970,9 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif APT(SP_DEMIGOD, SK_INVOCATIONS, UNUSABLE_SKILL), APT(SP_DEMIGOD, SK_EVOCATIONS, -1), - + // SP_TITAN - APT(SP_TITAN, SK_FIGHTING, 3), + APT(SP_TITAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_TITAN, SK_SHORT_BLADES, -1), APT(SP_TITAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_TITAN, SK_AXES, -1), @@ -1011,9 +1011,9 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif APT(SP_TITAN, SK_INVOCATIONS, UNUSABLE_SKILL), APT(SP_TITAN, SK_EVOCATIONS, -1), - + // SP_SPRIGGAN - APT(SP_SPRIGGAN, SK_FIGHTING, -2), + APT(SP_SPRIGGAN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_SPRIGGAN, SK_SHORT_BLADES, 1), APT(SP_SPRIGGAN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_SPRIGGAN, SK_AXES, -2), @@ -1054,7 +1054,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_SPRIGGAN, SK_EVOCATIONS, 3), // SP_MINOTAUR - APT(SP_MINOTAUR, SK_FIGHTING, 2), + APT(SP_MINOTAUR, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_MINOTAUR, SK_SHORT_BLADES, 2), APT(SP_MINOTAUR, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_MINOTAUR, SK_AXES, 2), @@ -1095,7 +1095,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_MINOTAUR, SK_EVOCATIONS, -1), // SP_GARGOYLE - APT(SP_GARGOYLE, SK_FIGHTING, 1), + APT(SP_GARGOYLE, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_GARGOYLE, SK_SHORT_BLADES, -1), APT(SP_GARGOYLE, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_GARGOYLE, SK_AXES, -1), @@ -1136,7 +1136,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_GARGOYLE, SK_EVOCATIONS, -1), // SP_DEMONSPAWN - APT(SP_DEMONSPAWN, SK_FIGHTING, 0), + APT(SP_DEMONSPAWN, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_DEMONSPAWN, SK_SHORT_BLADES, -1), APT(SP_DEMONSPAWN, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_DEMONSPAWN, SK_AXES, -1), @@ -1178,7 +1178,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_GHOUL - APT(SP_GHOUL, SK_FIGHTING, 1), + APT(SP_GHOUL, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_GHOUL, SK_SHORT_BLADES, -1), APT(SP_GHOUL, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_GHOUL, SK_AXES, -1), @@ -1214,7 +1214,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_TENGU - APT(SP_TENGU, SK_FIGHTING, 0), + APT(SP_TENGU, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_TENGU, SK_SHORT_BLADES, 2), APT(SP_TENGU, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_TENGU, SK_AXES, 2), @@ -1255,7 +1255,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_TENGU, SK_EVOCATIONS, 0), // SP_MERFOLK - APT(SP_MERFOLK, SK_FIGHTING, 1), + APT(SP_MERFOLK, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_MERFOLK, SK_SHORT_BLADES, 2), APT(SP_MERFOLK, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_MERFOLK, SK_AXES, -2), @@ -1296,7 +1296,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_MERFOLK, SK_EVOCATIONS, 0), // SP_VAMPIRE - APT(SP_VAMPIRE, SK_FIGHTING, -1), + APT(SP_VAMPIRE, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_VAMPIRE, SK_SHORT_BLADES, 1), APT(SP_VAMPIRE, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_VAMPIRE, SK_AXES, -1), @@ -1338,7 +1338,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_DEEP_DWARF - APT(SP_DEEP_DWARF, SK_FIGHTING, -1), + APT(SP_DEEP_DWARF, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_DEEP_DWARF, SK_SHORT_BLADES, -1), APT(SP_DEEP_DWARF, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_DEEP_DWARF, SK_AXES, 1), @@ -1373,7 +1373,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_DEEP_DWARF, SK_EVOCATIONS, 3), // SP_FELID - APT(SP_FELID, SK_FIGHTING, 0), + APT(SP_FELID, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_FELID, SK_SHORT_BLADES, UNUSABLE_SKILL), APT(SP_FELID, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_FELID, SK_AXES, UNUSABLE_SKILL), @@ -1407,9 +1407,9 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_FELID, SK_INVOCATIONS, 0), APT(SP_FELID, SK_EVOCATIONS, 1), #endif - + // SP_OCTOPODE - APT(SP_OCTOPODE, SK_FIGHTING, 0), + APT(SP_OCTOPODE, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_OCTOPODE, SK_SHORT_BLADES, 0), APT(SP_OCTOPODE, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_OCTOPODE, SK_AXES, 0), @@ -1451,7 +1451,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #if TAG_MAJOR_VERSION == 34 // SP_DJINNI - APT(SP_DJINNI, SK_FIGHTING, -1), + APT(SP_DJINNI, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_DJINNI, SK_SHORT_BLADES, -2), APT(SP_DJINNI, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_DJINNI, SK_AXES, -1), @@ -1486,7 +1486,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_DJINNI, SK_EVOCATIONS, 1), // SP_LAVA_ORC - APT(SP_LAVA_ORC, SK_FIGHTING, 2), + APT(SP_LAVA_ORC, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_LAVA_ORC, SK_SHORT_BLADES, 0), APT(SP_LAVA_ORC, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_LAVA_ORC, SK_AXES, 2), @@ -1522,7 +1522,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // SP_FORMICID - APT(SP_FORMICID, SK_FIGHTING, 1), + APT(SP_FORMICID, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_FORMICID, SK_SHORT_BLADES, 0), APT(SP_FORMICID, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_FORMICID, SK_AXES, 0), @@ -1563,7 +1563,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_FORMICID, SK_EVOCATIONS, 1), // SP_VINE_STALKER - APT(SP_VINE_STALKER, SK_FIGHTING, -1), + APT(SP_VINE_STALKER, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_VINE_STALKER, SK_SHORT_BLADES, -1), APT(SP_VINE_STALKER, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_VINE_STALKER, SK_AXES, -1), @@ -1602,10 +1602,10 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif APT(SP_VINE_STALKER, SK_INVOCATIONS, 0), APT(SP_VINE_STALKER, SK_EVOCATIONS, -1), - + #if TAG_MAJOR_VERSION == 34 // SP_FROGTAUR - APT(SP_FROGTAUR, SK_FIGHTING, 1), + APT(SP_FROGTAUR, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_FROGTAUR, SK_SHORT_BLADES, 0), APT(SP_FROGTAUR, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_FROGTAUR, SK_AXES, 0), @@ -1640,7 +1640,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_FROGTAUR, SK_EVOCATIONS, 0), #endif // SP_GNOLL - APT(SP_GNOLL, SK_FIGHTING, 4), + APT(SP_GNOLL, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_GNOLL, SK_SHORT_BLADES, 4), APT(SP_GNOLL, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_GNOLL, SK_AXES, 4), @@ -1677,9 +1677,9 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_GNOLL, SK_POISON_MAGIC, UNUSABLE_SKILL), APT(SP_GNOLL, SK_INVOCATIONS, 4), APT(SP_GNOLL, SK_EVOCATIONS, 4), - + // SP_SKELETON - APT(SP_SKELETON, SK_FIGHTING, -1), + APT(SP_SKELETON, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_SKELETON, SK_SHORT_BLADES, 0), APT(SP_SKELETON, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_SKELETON, SK_AXES, 0), diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index 6a984ade872..63d5928e5e4 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -159,17 +159,11 @@ int attack::calc_to_hit(bool random) // player_to_hit methods. if (attacker->is_player()) { - // fighting contribution - mhit += maybe_random_div(you.skill(SK_FIGHTING, 100), 100, random); - // weapon skill contribution if (using_weapon()) { - if (wpn_skill != SK_FIGHTING) - { - mhit += maybe_random_div(you.skill(wpn_skill, 100), 100, - random); - } + mhit += maybe_random_div(you.skill(wpn_skill, 100) * 2, 100, + random); } else if (you.form_uses_xl()) mhit += maybe_random_div(you.experience_level * 100, 100, random); @@ -351,8 +345,6 @@ void attack::init_attack(skill_type unarmed_skill, int attack_number) weapon = attacker->weapon(attack_number); wpn_skill = weapon ? item_attack_skill(*weapon) : unarmed_skill; - if (attacker->is_player() && you.form_uses_xl()) - wpn_skill = SK_FIGHTING; // for stabbing, mostly attacker_armour_tohit_penalty = div_rand_round(attacker->armour_tohit_penalty(true, 20), 20); @@ -1202,16 +1194,6 @@ int attack::player_apply_weapon_skill(int damage) return damage; } -int attack::player_apply_fighting_skill(int damage, bool aux) -{ - const int base = aux? 40 : 30; - - damage *= base * 100 + (random2(you.skill(SK_FIGHTING, 100) + 1)); - damage /= base * 100; - - return damage; -} - int attack::player_apply_misc_modifiers(int damage) { return damage; @@ -1355,7 +1337,6 @@ int attack::calc_damage() damage = random2(potential_damage+1); damage = player_apply_weapon_skill(damage); - damage = player_apply_fighting_skill(damage, false); damage = player_apply_misc_modifiers(damage); damage = player_apply_slaying_bonuses(damage, false); damage = player_stab(damage); diff --git a/crawl-ref/source/attack.h b/crawl-ref/source/attack.h index 3fb115875e9..fdcb43a040a 100644 --- a/crawl-ref/source/attack.h +++ b/crawl-ref/source/attack.h @@ -189,7 +189,6 @@ class attack virtual int player_stat_modify_damage(int damage); virtual int player_apply_weapon_skill(int damage); - virtual int player_apply_fighting_skill(int damage, bool aux); virtual int player_apply_misc_modifiers(int damage); virtual int player_apply_slaying_bonuses(int damage, bool aux); virtual int player_apply_final_multipliers(int damage); diff --git a/crawl-ref/source/contrib/sdl2 b/crawl-ref/source/contrib/sdl2 index 1e068b9cb99..0527bfaf5a7 160000 --- a/crawl-ref/source/contrib/sdl2 +++ b/crawl-ref/source/contrib/sdl2 @@ -1 +1 @@ -Subproject commit 1e068b9cb9947819f111f3fbaa2535263b37a67a +Subproject commit 0527bfaf5a7e44f995dc25d2a6860a736e644435 diff --git a/crawl-ref/source/contrib/sqlite b/crawl-ref/source/contrib/sqlite index 42f0cfa93c5..c8da44de4f2 160000 --- a/crawl-ref/source/contrib/sqlite +++ b/crawl-ref/source/contrib/sqlite @@ -1 +1 @@ -Subproject commit 42f0cfa93c5bffc184ad7961c766c229aff8d16c +Subproject commit c8da44de4f27147a9d756863a6f3c89f536af93c diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 4c90095c886..3f92c31cc17 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1330,10 +1330,7 @@ static string _describe_weapon(const item_def &item, bool verbose) description += " falls into the"; const skill_type skill = item_attack_skill(item); - - description += - make_stringf(" '%s' category. ", - skill == SK_FIGHTING ? "buggy" : skill_name(skill)); + description += make_stringf(" '%s' category. ", skill_name(skill)); description += _handedness_string(item); diff --git a/crawl-ref/source/exercise.cc b/crawl-ref/source/exercise.cc index 347df6b1510..0e99a998a83 100644 --- a/crawl-ref/source/exercise.cc +++ b/crawl-ref/source/exercise.cc @@ -161,9 +161,6 @@ static void _practise_weapon_use(const item_def &weapon) mindelay_skill); exercise(weapon_skill, degree); } - - if (coinflip()) - exercise(SK_FIGHTING, 1); } /// Skill training when the player hits a monster in melee combat. @@ -215,10 +212,7 @@ void practise_being_attacked() /// Skill training when a monster hits the player with a melee attack. void practise_being_hit() { - if (coinflip()) - _check_train_armour(coinflip() ? 2 : 1); - else if (coinflip()) - exercise(SK_FIGHTING, 1); + _check_train_armour(coinflip() ? 2 : 1); } /// Skill training when the player uses a special ability. diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index 534cbe2e701..e4ba1f9daa7 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -111,7 +111,7 @@ void ghost_demon::reset() species = SP_UNKNOWN; job = JOB_UNKNOWN; religion = GOD_NO_GOD; - best_skill = SK_FIGHTING; + best_skill = SK_UNARMED_COMBAT; best_skill_level = 0; xl = 0; max_hp = 0; @@ -333,7 +333,7 @@ void ghost_demon::init_player_ghost(bool actual_ghost) damage = property(weapon, PWPN_DAMAGE); // Bows skill doesn't make bow-bashing better. - skill_type sk = is_range_weapon(weapon) ? SK_FIGHTING + skill_type sk = is_range_weapon(weapon) ? SK_UNARMED_COMBAT : item_attack_skill(weapon); damage *= 25 + you.skills[sk]; damage /= 25; @@ -375,9 +375,6 @@ void ghost_demon::init_player_ghost(bool actual_ghost) damage += you.skills[SK_UNARMED_COMBAT]; } - damage *= 30 + you.skills[SK_FIGHTING]; - damage /= 30; - damage += you.strength() / 4; if (damage > MAX_GHOST_DAMAGE) diff --git a/crawl-ref/source/godpassive.cc b/crawl-ref/source/godpassive.cc index 8fbfc37ec2c..9bc7ef72201 100644 --- a/crawl-ref/source/godpassive.cc +++ b/crawl-ref/source/godpassive.cc @@ -1177,7 +1177,7 @@ monster* shadow_monster(bool equip) you.skill_rdiv(wpn_index != NON_ITEM ? item_attack_skill(mitm[wpn_index]) : SK_UNARMED_COMBAT, 10, 20) - + you.skill_rdiv(SK_FIGHTING, 10, 20)))); + + piety_rank()))); mon->set_position(you.pos()); mon->mid = MID_PLAYER; mon->inv[MSLOT_WEAPON] = wpn_index; diff --git a/crawl-ref/source/hints.cc b/crawl-ref/source/hints.cc index fe25951fcc1..f767e5048e1 100644 --- a/crawl-ref/source/hints.cc +++ b/crawl-ref/source/hints.cc @@ -695,7 +695,6 @@ void hints_gained_new_skill(skill_type skill) switch (skill) { // Special cases first. - case SK_FIGHTING: case SK_ARMOUR: case SK_STEALTH: case SK_UNARMED_COMBAT: diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 9d224dcf1f1..f7a8e24a442 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1412,7 +1412,7 @@ static map hide_to_mons = _make_hide_monster_map(); * * @param arm The type of armour in question. * @return The corresponding monster type; e.g. MONS_FIRE_DRAGON for - * ARM_FIRE_DRAGON_ARMOUR, + * ARM_FIRE_DRAGON_ARMOUR, * MONS_TROLL for ARM_TROLL_LEATHER_ARMOUR... */ monster_type monster_for_hide(armour_type arm) @@ -1451,7 +1451,7 @@ int armour_acq_weight(const armour_type armour) equipment_type get_armour_slot(const item_def &item) { ASSERT(item.base_type == OBJ_ARMOUR || item.base_type == OBJ_STAVES); - + if(item.base_type == OBJ_STAVES) return EQ_SHIELD; @@ -1584,11 +1584,11 @@ int wand_charge_value(int type) return 4; default: - return 5; + return 5; case WAND_FLAME: case WAND_CONFUSION: - return 6; + return 6; } } @@ -1918,7 +1918,7 @@ bool is_brandable_weapon(const item_def &wpn, bool allow_ranged, bool divine) * * @param item The item under consideration. * @return The skill used to attack with the given item; defaults to - * SK_FIGHTING if no melee or ranged skill applies. + * SK_UNARMED_COMBAT if no melee or ranged skill applies. */ skill_type item_attack_skill(const item_def &item) { @@ -1930,7 +1930,7 @@ skill_type item_attack_skill(const item_def &item) return SK_THROWING; // This is used to mark that only fighting applies. - return SK_FIGHTING; + return SK_UNARMED_COMBAT; } /** @@ -1939,7 +1939,7 @@ skill_type item_attack_skill(const item_def &item) * @param wclass The item base type under consideration. * @param wtype The item subtype under consideration. * @return The skill used to attack with the given item type; defaults to - * SK_FIGHTING if no melee skill applies. + * SK_UNARMED_COMBAT if no melee skill applies. */ skill_type item_attack_skill(object_class_type wclass, int wtype) { @@ -2018,7 +2018,7 @@ bool item_skills(const item_def &item, set &skills) } skill_type sk = item_attack_skill(item); - if (sk != SK_FIGHTING && sk != SK_THROWING) + if (sk != SK_THROWING) skills.insert(sk); return !skills.empty(); @@ -2832,7 +2832,7 @@ equipment_type get_item_slot(object_class_type type, int sub_type) case OBJ_ARMOUR: return get_armour_slot(static_cast(sub_type)); - + case OBJ_STAVES: return EQ_SHIELD; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index ad83d9f6ee0..bae12a6fa22 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -4576,7 +4576,7 @@ bool get_item_by_name(item_def *item, const char* specs, else { mpr("Sorry, no books on that skill today."); - item->skill = SK_FIGHTING; // Was probably that anyway. + item->skill = SK_UNARMED_COMBAT; } item->skill_points = random_range(2000, 3000); } diff --git a/crawl-ref/source/job-data.h b/crawl-ref/source/job-data.h index 239f19fa06e..075569d0ba1 100644 --- a/crawl-ref/source/job-data.h +++ b/crawl-ref/source/job-data.h @@ -38,7 +38,7 @@ static const map job_data = { SP_FORMICID, SP_DEEP_ELF, SP_KOBOLD, SP_SPRIGGAN, SP_TROLL, }, { "robe", "book of Arcane Marksmanship" }, WCHOICE_RANGED, - { { SK_FIGHTING, 1 }, { SK_DODGING, 2 }, + { { SK_DODGING, 2 }, { SK_HEXES, 4 }, { SK_WEAPON, 2 }, }, } }, @@ -50,7 +50,7 @@ static const map job_data = { "dagger", "leather armour", "wand of flame charges:15", "wand of enslavement charges:15", "wand of iceblast charges:1" }, WCHOICE_NONE, - { { SK_EVOCATIONS, 3 }, { SK_DODGING, 2 }, { SK_FIGHTING, 1 }, + { { SK_EVOCATIONS, 3 }, { SK_DODGING, 2 }, { SK_WEAPON, 1 }, { SK_STEALTH, 1 }, }, } }, @@ -61,7 +61,7 @@ static const map job_data = SP_DEMONSPAWN, }, { "animal skin" }, WCHOICE_PLAIN, - { { SK_FIGHTING, 3 }, { SK_DODGING, 2 }, { SK_WEAPON, 3 }, }, + { { SK_DODGING, 2 }, { SK_WEAPON, 3 }, }, } }, { JOB_CHAOS_KNIGHT, { @@ -71,7 +71,7 @@ static const map job_data = SP_BASE_DRACONIAN, SP_DEMONSPAWN, }, { "leather armour plus:2" }, WCHOICE_PLAIN, - { { SK_FIGHTING, 3 }, { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, + { { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, { SK_WEAPON, 3 } }, } }, @@ -102,7 +102,7 @@ static const map job_data = { SP_MOUNTAIN_DWARF, SP_TROLL, SP_MINOTAUR, SP_GARGOYLE, SP_GNOLL }, { "scale mail", "shield", "potion of augmentation" }, WCHOICE_GOOD, - { { SK_FIGHTING, 3 }, { SK_SHIELDS, 3 }, { SK_ARMOUR, 3 }, + { { SK_SHIELDS, 3 }, { SK_ARMOUR, 3 }, { SK_WEAPON, 2 } }, } }, @@ -122,7 +122,7 @@ static const map job_data = { SP_MOUNTAIN_DWARF, SP_MERFOLK, SP_MINOTAUR, SP_GARGOYLE, SP_GNOLL}, { "leather armour", "helmet", "poisoned dart q:12", "curare dart q:3"}, WCHOICE_GOOD, - { { SK_FIGHTING, 2 }, { SK_THROWING, 2 }, { SK_DODGING, 3 }, + { { SK_THROWING, 2 }, { SK_DODGING, 3 }, { SK_WEAPON, 3}, }, } }, @@ -132,7 +132,7 @@ static const map job_data = { SP_MOUNTAIN_DWARF, SP_KOBOLD, SP_TROLL, SP_GNOLL}, { "dagger", "leather armour" }, WCHOICE_RANGED, - { { SK_FIGHTING, 2 }, { SK_DODGING, 2 }, { SK_STEALTH, 1 }, + { { SK_DODGING, 2 }, { SK_STEALTH, 1 }, { SK_WEAPON, 4 }, }, } }, @@ -153,7 +153,7 @@ static const map job_data = { SP_MOUNTAIN_DWARF, SP_TROLL, SP_MERFOLK, SP_GARGOYLE, SP_DEMONSPAWN, }, { "robe" }, WCHOICE_PLAIN, - { { SK_FIGHTING, 3 }, { SK_WEAPON, 3 }, { SK_DODGING, 3 }, + { { SK_WEAPON, 3 }, { SK_DODGING, 3 }, { SK_STEALTH, 2 }, {SK_INVOCATIONS, 3} }, } }, @@ -174,7 +174,7 @@ static const map job_data = { SP_MERFOLK, SP_BASE_DRACONIAN, SP_VAMPIRE, SP_GNOLL}, { "leather armour", "book of Battle" }, WCHOICE_PLAIN, - { { SK_FIGHTING, 2 }, { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, + { { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, { SK_CHARMS, 4 }, { SK_WEAPON, 2 }, }, } }, @@ -195,7 +195,7 @@ static const map job_data = { SP_MINOTAUR, SP_FORMICID, SP_MOUNTAIN_DWARF, SP_DEMONSPAWN, }, { "plate armour ego:ponderousness" }, WCHOICE_PLAIN, - { { SK_FIGHTING, 2 }, { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, + { { SK_ARMOUR, 1 }, { SK_DODGING, 1 }, { SK_WEAPON, 3 }, { SK_INVOCATIONS, 2 }, }, } }, @@ -206,7 +206,7 @@ static const map job_data = SP_TROLL, }, { "robe", "book of Changes" }, WCHOICE_NONE, - { { SK_FIGHTING, 1 }, { SK_UNARMED_COMBAT, 3 }, { SK_DODGING, 2 }, + { { SK_UNARMED_COMBAT, 3 }, { SK_DODGING, 2 }, { SK_TRANSMUTATIONS, 3 }, }, } }, diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index 38e7ae27831..7aba3d4d746 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -481,7 +481,7 @@ IDEF(weap_skill) return 0; const skill_type skill = item_attack_skill(*item); - if (skill == SK_FIGHTING) + if (skill == SK_UNARMED_COMBAT) return 0; lua_pushstring(ls, skill_name(skill)); diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index f8d3b711255..7d9f73a0571 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -79,7 +79,7 @@ melee_attack::melee_attack(actor *attk, actor *defn, damage_brand = attacker->damage_brand(attack_number); init_attack(SK_UNARMED_COMBAT, attack_number); if (weapon && !using_weapon()) - wpn_skill = SK_FIGHTING; + wpn_skill = SK_UNARMED_COMBAT; attack_position = attacker->pos(); } @@ -360,24 +360,24 @@ bool melee_attack::handle_phase_hit() return false; } - + if (attacker->is_player() && you.attribute[ATTR_SPECTRAL_WEAPON] && !(you.duration[DUR_SPECTRAL_WEAPON_COOLDOWN] > 0) && !mons_is_firewood(*defender->as_monster())) { - summon_spectral_weapon(&you, calc_spell_power(SPELL_SPECTRAL_WEAPON,true),you.religion); + summon_spectral_weapon(&you, calc_spell_power(SPELL_SPECTRAL_WEAPON,true),you.religion); } - + if (attacker->is_player() && you.duration[DUR_MIASMATA]) { //scale the chance to do anything with necro skill if(x_chance_in_y(10 + you.skill_rdiv(SK_NECROMANCY, 2, 3), 50)) { - mprf("You engulf %s in miasma!", + mprf("You engulf %s in miasma!", you.can_see(*defender)? defender->name(DESC_THE).c_str() : "something"); place_cloud(CLOUD_MIASMA, defender->pos(), 5 + random2(6), &you); } } - + if (attacker->is_player() && you.attribute[ATTR_INFESTATION]) { if(!defender->is_summoned() && !(defender->as_monster()->flags & MF_HARD_RESET)) @@ -785,7 +785,7 @@ bool melee_attack::attack() ev_margin = AUTOMATIC_HIT; shield_blocked = false; } - + // Serpent's Lash does not miss if (wu_jian_has_momentum(wu_jian_attack)) ev_margin = AUTOMATIC_HIT; @@ -1169,7 +1169,7 @@ void melee_attack::player_aux_setup(unarmed_attack_type atk) if (wu_jian_attack != WU_JIAN_ATTACK_NONE) wu_jian_attack = WU_JIAN_ATTACK_TRIGGERED_AUX; - + if (atk == UNAT_BITE && _vamp_wants_blood_from_monster(defender->as_monster())) { @@ -1303,8 +1303,6 @@ bool melee_attack::player_aux_apply(unarmed_attack_type atk) aux_damage = random2(aux_damage); - aux_damage = player_apply_fighting_skill(aux_damage, true); - aux_damage = player_apply_misc_modifiers(aux_damage); aux_damage = player_apply_slaying_bonuses(aux_damage, true); @@ -1404,7 +1402,7 @@ void melee_attack::player_announce_aux_hit() string melee_attack::player_why_missed() { - //roses are red, violets are blue, + //roses are red, violets are blue, //the code that was here before was misleading, and it was useless too return "You" + evasion_margin_adverb() + " miss "; } @@ -1817,7 +1815,7 @@ void melee_attack::handle_noise(const coord_def & pos) return; int loudness = damage_done / 4; - + if(attacker->is_player() && you.attribute[ATTR_SONG_OF_SLAYING]) { loudness += random2(5) + 1; @@ -2016,7 +2014,7 @@ void melee_attack::apply_staff_damage() } std::string d = std::to_string(0); - + switch (weapon->sub_type) { case STAFF_AIR: @@ -2363,7 +2361,7 @@ bool melee_attack::mons_attack_effects() if (attacker != defender && defender->alive()) { mons_apply_attack_flavour(); - + if(mons_class_flag(attacker->type, M_INVIS) &&!defender->can_see(*attacker)) attacker->as_monster()->del_ench(ENCH_INVIS, true); @@ -2656,7 +2654,7 @@ void melee_attack::mons_apply_attack_flavour() drain_defender(); break; - case AF_CONTAM: + case AF_CONTAM: if(defender->is_player()) { contaminate_player(1000 + random2(1000), false); @@ -2668,7 +2666,7 @@ void melee_attack::mons_apply_attack_flavour() "mutagenic touch"); } break; - + case AF_PARALYSE: { // Only wasps at the moment, so Zin vitalisation @@ -3147,7 +3145,7 @@ void melee_attack::do_minotaur_retaliation() if(!defender->airborne()) return; } - + if (!defender->is_player()) { // monsters have no STR or DEX @@ -3193,7 +3191,6 @@ void melee_attack::do_minotaur_retaliation() int dmg = 5 + mut * 3; dmg = player_stat_modify_damage(dmg); dmg = random2(dmg); - dmg = player_apply_fighting_skill(dmg, true); dmg = player_apply_misc_modifiers(dmg); dmg = player_apply_slaying_bonuses(dmg, true); dmg = player_apply_final_multipliers(dmg); @@ -3366,7 +3363,7 @@ bool melee_attack::_extra_aux_attack(unarmed_attack_type atk) { return false; } - + if (wu_jian_attack != WU_JIAN_ATTACK_NONE && !x_chance_in_y(1, wu_jian_number_of_targets)) { @@ -3428,8 +3425,7 @@ int melee_attack::calc_your_to_hit_unarmed(int uattack) int your_to_hit; your_to_hit = 1300 - + you.dex() * 75 - + you.skill(SK_FIGHTING, 30); + + you.dex() * 100; your_to_hit /= 100; your_to_hit -= 5 * you.inaccuracy(); diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index 43975332d2a..4d57d252084 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -359,7 +359,7 @@ monster_info::monster_info(monster_type p_type, monster_type p_base_type) i_ghost.species = SP_HUMAN; i_ghost.job = JOB_WANDERER; i_ghost.religion = GOD_NO_GOD; - i_ghost.best_skill = SK_FIGHTING; + i_ghost.best_skill = SK_UNARMED_COMBAT; i_ghost.best_skill_rank = 2; i_ghost.xl_rank = 3; hd = ghost_rank_to_level(i_ghost.xl_rank); @@ -1354,7 +1354,7 @@ void monster_info::to_string(int count, string& desc, int& desc_colour, } break; } - + if (colour_type < _NUM_MLC) desc_colour = _monster_list_colours[colour_type]; diff --git a/crawl-ref/source/ng-wanderer.cc b/crawl-ref/source/ng-wanderer.cc index 9559d90039e..057d84d8be3 100644 --- a/crawl-ref/source/ng-wanderer.cc +++ b/crawl-ref/source/ng-wanderer.cc @@ -115,7 +115,7 @@ static skill_type _wanderer_role_skill_select(stat_type selected_role, { case STAT_DEX: // Duplicates are intentional. - selected_skill = random_choose(SK_FIGHTING, SK_FIGHTING, + selected_skill = random_choose(SK_DODGING, SK_DODGING, SK_STEALTH, sk_1, sk_1); @@ -124,7 +124,7 @@ static skill_type _wanderer_role_skill_select(stat_type selected_role, case STAT_STR: do { - selected_skill = random_choose(SK_FIGHTING, sk_1, SK_ARMOUR); + selected_skill = random_choose(sk_1, SK_ARMOUR); } while (is_useless_skill(selected_skill)); break; @@ -435,23 +435,6 @@ static void _wanderer_good_equipment(skill_type & skill) int total_weapons = ARRAYSZ(combined_weapon_skills); - // Normalise the input type. - if (skill == SK_FIGHTING) - { - int max_sklev = 0; - skill_type max_skill = SK_NONE; - - for (int i = 0; i < total_weapons; ++i) - { - if (you.skills[combined_weapon_skills[i]] >= max_sklev) - { - max_skill = combined_weapon_skills[i]; - max_sklev = you.skills[max_skill]; - } - } - skill = max_skill; - } - switch (skill) { case SK_MACES_FLAILS: @@ -468,7 +451,7 @@ static void _wanderer_good_equipment(skill_type & skill) break; case SK_DODGING: - // +2 leather armour + // +2 leather armour newgame_make_item(OBJ_ARMOUR, ARM_LEATHER_ARMOUR, 1, 2); break; @@ -524,25 +507,6 @@ static void _wanderer_decent_equipment(skill_type & skill, int total_weapons = ARRAYSZ(combined_weapon_skills); - // If fighting comes up, give something from the highest weapon - // skill. - if (skill == SK_FIGHTING) - { - int max_sklev = 0; - skill_type max_skill = SK_NONE; - - for (int i = 0; i < total_weapons; ++i) - { - if (you.skills[combined_weapon_skills[i]] >= max_sklev) - { - max_skill = combined_weapon_skills[i]; - max_sklev = you.skills[max_skill]; - } - } - - skill = max_skill; - } - // Don't give a gift from the same skill twice; just default to // a decent consumable if (gift_skills.count(skill)) diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 81212ad58f1..c7f953b7252 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -640,7 +640,7 @@ int do_shave_damage(int dam) { if (!can_shave_damage()) return dam; - + if (dam == 0) return dam; @@ -792,7 +792,7 @@ void ouch(int dam, kill_method_type death_type, mid_t source, const char *aux, // big hit warning (in this case, a hit for half our HPs) -- bwr if (dam > 0 && you.hp_max <= dam * 2) mprf(MSGCH_DANGER, "Ouch! That really hurt!"); - + if (you.hp > 0 && dam > 0) { if (Options.hp_warning diff --git a/crawl-ref/source/player-equip.cc b/crawl-ref/source/player-equip.cc index 6bd8844b6d5..4bc71dfd0b6 100644 --- a/crawl-ref/source/player-equip.cc +++ b/crawl-ref/source/player-equip.cc @@ -374,7 +374,7 @@ static void _wield_cursed(item_def& item, bool known_cursed, bool unmeld) amusement *= 2; } const int wpn_skill = item_attack_skill(item.base_type, item.sub_type); - if (wpn_skill != SK_FIGHTING && you.skills[wpn_skill] == 0) + if (wpn_skill != SK_UNARMED_COMBAT && you.skills[wpn_skill] == 0) amusement *= 2; } @@ -479,7 +479,7 @@ static void _equip_weapon_effect(item_def& item, bool showMsgs, bool unmeld) case SPWPN_SPEED: mpr(you.hands_act("tingle", "!")); break; - + case SPWPN_DEVASTATION: mpr("You feel an incredible weight."); break; @@ -809,7 +809,7 @@ static void _equip_armour_effect(item_def& arm, bool unmeld, case SPARM_PROTECTION: mpr("You feel protected."); break; - + case SPARM_MAGICAL_POWER: canned_msg(MSG_MANA_INCREASE); calc_mp(); @@ -961,7 +961,7 @@ static void _unequip_armour_effect(item_def& item, bool meld, case SPARM_PROTECTION: mpr("You feel less protected."); break; - + case SPARM_MAGICAL_POWER: canned_msg(MSG_MANA_DECREASE); calc_mp(); @@ -1047,8 +1047,8 @@ static void _equip_amulet_of_regeneration() else { mprf("You sense that the amulet cannot attune itself to your %s" - " body.", you.hp == you.hp_max ? "exhausted" : - you.magic_points == you.max_magic_points ? "injured" : + " body.", you.hp == you.hp_max ? "exhausted" : + you.magic_points == you.max_magic_points ? "injured" : "injured and exhausted"); you.props[REGEN_AMULET_ACTIVE] = 0; } @@ -1151,7 +1151,7 @@ static void _equip_jewellery_effect(item_def &item, bool unmeld, case AMU_GUARDIAN_SPIRIT: _spirit_shield_message(unmeld); break; - + case AMU_DESTRUCTION: if (!unmeld) _equip_amulet_of_destruction(); @@ -1244,7 +1244,7 @@ static void _unequip_jewellery_effect(item_def &item, bool mesg, bool meld, if (!meld) _remove_amulet_of_faith(item); break; - + case AMU_DESTRUCTION: if(you.duration[DUR_DESTRUCTION]) you.duration[DUR_DESTRUCTION] = 0; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 6b03832edea..c98bac2203c 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -219,7 +219,7 @@ static bool _check_moveto_dangerous(const coord_def& p, const string& msg) } else return true; } - + if (you.can_swim() && feat_is_water(env.grid(p)) || you.airborne() || !is_feat_dangerous(env.grid(p))) { @@ -242,7 +242,7 @@ bool check_moveto_terrain(const coord_def& p, const string &move_verb, { if (!_check_moveto_dangerous(p, msg)) return false; - + if (!need_expiration_warning() && need_expiration_warning(p) && !crawl_state.disables[DIS_CONFIRMATIONS]) { @@ -455,7 +455,7 @@ void moveto_location_effects(dungeon_feature_type old_feat, mpr("You slowly pull yourself out of the lava."); you.time_taken *= 2; } - + else if (feat_is_lava(new_grid) && feat_is_lava(old_feat)) { if (stepped) @@ -474,7 +474,7 @@ void moveto_location_effects(dungeon_feature_type old_feat, ASSERT(new_grid == DNGN_SHALLOW_WATER || new_grid == DNGN_DEEP_WATER); const bool shallow = new_grid == DNGN_SHALLOW_WATER; - + if (stepped) { const int penalty = shallow ? 3 : 5; @@ -594,9 +594,9 @@ bool is_feat_unpleasant(dungeon_feature_type grid, bool permanently, else if (grid == DNGN_DEEP_WATER && !player_likes_water(permanently) || grid == DNGN_LAVA && !player_likes_lava(permanently)) { - return true; + return true; } - else + else return false; } @@ -699,7 +699,7 @@ void update_vision_range() nom *= LOS_DEFAULT_RANGE + 1; denom *= LOS_DEFAULT_RANGE; } - + // Nightstalker gives -1/-2/-3. if (you.get_mutation_level(MUT_NIGHTSTALKER)) { @@ -1389,7 +1389,7 @@ int player_res_fire(bool calc_unid, bool temp, bool items) if (you.duration[DUR_FIRE_SHIELD]) rf += 2; - + if (you.attribute[ATTR_FIRE_SHIELD]) rf += 2; @@ -1737,7 +1737,7 @@ int player_spec_fire() if (you.duration[DUR_FIRE_SHIELD]) sf++; - + if (you.attribute[ATTR_FIRE_SHIELD]) sf++; @@ -1751,7 +1751,7 @@ int player_spec_cold() // staves: sc += you.wearing(EQ_SHIELD, STAFF_COLD); - // demonspawn ice enhancer + // demonspawn ice enhancer sc += you.get_mutation_level(MUT_ICE_ENHANCER); // rings of ice: @@ -1775,7 +1775,7 @@ int player_spec_earth() // Staves se += you.wearing(EQ_SHIELD, STAFF_EARTH); - + // Earth enhancer goodmut se += you.get_mutation_level(MUT_EARTH_ENHANCER); @@ -1788,7 +1788,7 @@ int player_spec_air() // Staves sa += you.wearing(EQ_SHIELD, STAFF_AIR); - + // Air enhancer goodmut sa += you.get_mutation_level(MUT_AIR_ENHANCER); @@ -1803,7 +1803,7 @@ int player_spec_conj() int player_spec_hex() { int sh = 0; - + // Hex enhancer goodmut sh += you.get_mutation_level(MUT_HEX_ENHANCER); @@ -1825,7 +1825,7 @@ int player_spec_summ() // Staves ss += you.wearing(EQ_SHIELD, STAFF_SUMMONING); - + // Summon enhancer goodmut ss += you.get_mutation_level(MUT_SUMMON_ENHANCER); @@ -1874,7 +1874,7 @@ int player_prot_life(bool calc_unid, bool temp, bool items) // completely stoned, unlike statue which has some life force if (you.petrified()) pl += 3; - + if (you.duration[DUR_RESISTANCE]) pl++; } @@ -2318,7 +2318,7 @@ int player_shield_class() shield += (you.get_mutation_level(MUT_CRYSTAL_SKIN) > 0 ? you.get_mutation_level(MUT_CRYSTAL_SKIN) * 600 + 600 : 0); - + shield += qazlal_sh_boost() * 100; shield += tso_sh_boost() * 100; shield += _bone_armour_bonus() * 2; @@ -2559,9 +2559,9 @@ static void _handle_stat_loss(int exp) //special case since their skill exp gain is whack if (you.species == SP_KOBOLD || you.species == SP_GNOLL) { - loss = div_rand_round(exp * 3 / 2, + loss = div_rand_round(exp * 3 / 2, max(1, calc_skill_cost(you.experience_level) - 3)); - } + } you.attribute[ATTR_STAT_LOSS_XP] -= loss; dprf("Stat loss points: %d", you.attribute[ATTR_STAT_LOSS_XP]); if (you.attribute[ATTR_STAT_LOSS_XP] <= 0) @@ -2582,7 +2582,7 @@ static void _handle_xp_drain(int exp) if (you.species == SP_KOBOLD || you.species == SP_GNOLL) { loss = div_rand_round(exp * 3 / 2, calc_skill_cost(you.experience_level)); - } + } // Make it easier to recover from very heavy levels of draining // (they're nasty enough as it is) @@ -2661,7 +2661,7 @@ void gain_exp(unsigned int exp_gained, unsigned int* actual_gain) _recharge_xp_evokers(skill_xp); _reduce_abyss_xp_timer(skill_xp); _handle_xp_drain(skill_xp); - + //for difficulty levels other than normal, //multiply both exp gain and skill exp (but don't multiply xp-gated effects) if (crawl_state.difficulty == DIFFICULTY_CASUAL || crawl_state.difficulty == DIFFICULTY_SPEEDRUN) @@ -2675,7 +2675,7 @@ void gain_exp(unsigned int exp_gained, unsigned int* actual_gain) // handle actual experience gains, // i.e. XL and skills - + const unsigned int old_exp = you.experience; dprf("gain_exp: %d", exp_gained); @@ -3145,7 +3145,7 @@ int check_stealth() if (you.duration[DUR_AGILITY]) stealth += STEALTH_PIP; - + if (cloak && get_armour_ego_type(*cloak) == SPARM_STEALTH) stealth += STEALTH_PIP; @@ -3168,7 +3168,7 @@ int check_stealth() // which pretty much gives away the stealth game. if (you.duration[DUR_SILENCE]) stealth -= STEALTH_PIP; - + if (you.species == SP_VAMPIRE) stealth += STEALTH_PIP; // innate vampire stealth boost @@ -3215,7 +3215,7 @@ int check_stealth() stealth *= umbra_mul; stealth /= umbra_div; } - + if (you.form == TRAN_SHADOW) stealth *= 2; @@ -3536,14 +3536,14 @@ int slaying_bonus(bool ranged) if (you.duration[DUR_HORROR]) ret -= you.props[HORROR_PENALTY_KEY].get_int(); - + if (have_passive(passive_t::wu_jian_glass_cannon) && !ranged) { ret += 3 * piety_rank(); } ret += you.attribute[ATTR_HEAVENLY_STORM]; - + return ret; } @@ -3936,11 +3936,8 @@ int get_real_hp(bool trans, bool rotted) { int hitp; - hitp = you.experience_level * 11 / 2 + 8; + hitp = 6 + (you.experience_level * 8); hitp += you.hp_max_adj_perm; - // Important: we shouldn't add Heroism boosts here. - hitp += you.experience_level * you.skill(SK_FIGHTING, 5, true) / 70 - + (you.skill(SK_FIGHTING, 3, true) + 1) / 2; // Racial modifier. hitp *= 10 + species_hp_modifier(you.species); @@ -4008,12 +4005,12 @@ int get_real_mp(bool include_items, bool frozen) enp += 9; if(you.wearing_ego(EQ_HELMET, SPARM_MAGICAL_POWER)) enp += 9; - enp += you.scan_artefacts(ARTP_MAGICAL_POWER); + enp += you.scan_artefacts(ARTP_MAGICAL_POWER); } if (include_items && you.wearing_ego(EQ_WEAPON, SPWPN_ANTIMAGIC)) enp /= 3; - + if (!frozen) enp -= you.mp_frozen; enp = max(enp, 0); @@ -4170,7 +4167,7 @@ bool confuse_player(int amount, bool quiet, bool force) if (amount <= 0) return false; - + if (you.duration[DUR_CONF] || you.duration[DUR_CONFUSION_IMMUNITY]) { mpr("You shrug off the repeated confusion!"); @@ -4183,13 +4180,13 @@ bool confuse_player(int amount, bool quiet, bool force) mpr("You feel momentarily confused."); return false; } - + if(!force && have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from confusion."); return false; } - + if (!force && you.duration[DUR_DIVINE_STAMINA] > 0) { if (!quiet) @@ -4206,7 +4203,6 @@ bool confuse_player(int amount, bool quiet, bool force) } learned_something_new(HINT_YOU_ENCHANTED); - return true; } @@ -4230,7 +4226,7 @@ bool poison_player(int amount, string source, string source_aux, bool force) mpr("Your divine stamina protects you from poison!"); return false; } - + if(have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from poison."); @@ -4250,7 +4246,7 @@ bool poison_player(int amount, string source, string source_aux, bool force) if (player_res_poison() < 0) amount *= 2; - + // stepdown high poison values amount = stepdown_value(amount, 30, 30, 120, 120); @@ -4569,7 +4565,7 @@ bool slow_player(int turns, bool force) if (check_stasis()) return false; - + if(!force && have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from slowing."); @@ -5664,7 +5660,7 @@ int player::missile_deflection() const return 2; else return 1; } - + // non-spell version of rmsl always triggers if (you.get_mutation_level(MUT_DISTORTION_FIELD) == 3 || scan_artefacts(ARTP_RMSL, true) @@ -5814,7 +5810,7 @@ int player_icemail_armour_class() if (!you.has_mutation(MUT_ICEMAIL)) return 0; - return you.duration[DUR_ICEMAIL_DEPLETED] ? 0 : + return you.duration[DUR_ICEMAIL_DEPLETED] ? 0 : you.get_mutation_level(MUT_ICEMAIL) > 1 ? ICEMAIL_MAX : ICEMAIL_MAX / 2; } @@ -5830,7 +5826,7 @@ static int _bone_armour_bonus() { if(you.attribute[ATTR_SKELETON_ARMOUR]) return you.attribute[ATTR_SKELETON_ARMOUR] * 100; - + if (!you.attribute[ATTR_BONE_ARMOUR]) return 0; @@ -6323,7 +6319,7 @@ int player_res_magic(bool calc_unid, bool temp) if (you.duration[DUR_RESISTANCE]) rm += MR_PIP; - + // Trog's Hand if (you.duration[DUR_TROGS_HAND] && temp) rm += MR_PIP * 2; @@ -6587,7 +6583,7 @@ void player::drain_stat(stat_type s, int amount) simple_god_message(" protects you from stat loss."); return; } - + lose_stat(s, amount); } @@ -6603,7 +6599,7 @@ bool player::rot(actor *who, int amount, bool quiet, bool /*no_cleanup*/) mpr("You feel terrible."); return false; } - + if(have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from rotting."); @@ -6681,7 +6677,7 @@ void player::splash_with_acid(const actor* evildoer, int acid_strength, const int dam = roll_dice(4, acid_strength); const int post_res_dam = resist_adjust_damage(&you, BEAM_ACID, dam); - std::string d = std::to_string(post_res_dam); + std::string d = std::to_string(post_res_dam); mpr("You are splashed with acid!"); if (post_res_dam > 0) @@ -6768,7 +6764,7 @@ void player::petrify(actor *who, bool force) canned_msg(MSG_YOU_UNAFFECTED); return; } - + if(have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from petrification."); @@ -6995,7 +6991,7 @@ bool player::sicken(int amount) mpr("Your divine stamina protects you from disease!"); return false; } - + if(have_passive(passive_t::purification) && x_chance_in_y(you.piety, 200)) { simple_god_message(" protects you from disease."); @@ -7051,7 +7047,7 @@ bool player::innate_sinv() const bool player::invisible() const { - return (attribute[ATTR_PERMAINVIS] || duration[DUR_INVIS] + return (attribute[ATTR_PERMAINVIS] || duration[DUR_INVIS] || form == TRAN_SHADOW) && !backlit(); } @@ -7599,7 +7595,7 @@ void player::weaken(actor *attacker, int pow) simple_god_message(" protects you from weakness."); return; } - + if (!duration[DUR_WEAK]) mprf(MSGCH_WARN, "You feel your attacks grow feeble."); else diff --git a/crawl-ref/source/skills.cc b/crawl-ref/source/skills.cc index 8b4711faee5..d813360dc2d 100644 --- a/crawl-ref/source/skills.cc +++ b/crawl-ref/source/skills.cc @@ -308,19 +308,11 @@ static void _change_skill_level(skill_type exsk, int n) if (need_reset) reset_training(); - - // calc_hp() has to be called here because it currently doesn't work - // right if you.skills[] hasn't been updated yet. - if (exsk == SK_FIGHTING) - recalc_and_scale_hp(); } // Called whenever a skill is trained. void redraw_skill(skill_type exsk, skill_type old_best_skill) { - if (exsk == SK_FIGHTING) - recalc_and_scale_hp(); - if (exsk == SK_DODGING || exsk == SK_ARMOUR) you.redraw_evasion = true; @@ -1831,17 +1823,6 @@ int transfer_skill_points(skill_type fsk, skill_type tsk, int skp_max, total_skp_lost += skp_lost; change_skill_points(fsk, -skp_lost, false); - // If reducing fighting would reduce your maxHP to 0 or below, - // we cancel the last step and end the transfer. - if (fsk == SK_FIGHTING && get_real_hp(false, true) <= 0) - { - change_skill_points(fsk, skp_lost, false); - total_skp_lost -= skp_lost; - if (!simu) - you.transfer_skill_points = total_skp_lost; - break; - } - total_skp_gained += skp_gained; if (fsk != tsk)