From 9d4364b27162da44c3c3e075ebaaba9845c85530 Mon Sep 17 00:00:00 2001 From: advil Date: Sun, 26 Nov 2017 13:44:07 -0500 Subject: [PATCH 1/7] Update Makefile for SDL-2.0.7 on OS X Apparently some more frameworks are needed to link SDL. --- crawl-ref/source/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile index 949ac7d59df..8c029746230 100644 --- a/crawl-ref/source/Makefile +++ b/crawl-ref/source/Makefile @@ -227,7 +227,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 From 88f29388514268b1be74ce97f01575265ec5b48c Mon Sep 17 00:00:00 2001 From: Aaron Golden Date: Thu, 17 Nov 2016 22:48:28 -0800 Subject: [PATCH 2/7] Change Mac OS X build arguments There is no reason to specify the SDK root because we can always build with the latest available Mac OS X SDK. The minimum version of Mac OS X that the binary supports can be less than the SDK with which the binary was built. We can set the deployment target all the way back to 10.7 as long as we also build using clang's libc++ instead of gcc's libstdc++. Strangely, if you try to set the deployment target less than 10.9 and use libstdc++, some necesary headers (e.g. cinttypes) are not found in the standard places. But this is not a problem if we build using clang's libc++. --- crawl-ref/source/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile index 8c029746230..f1f680763ae 100644 --- a/crawl-ref/source/Makefile +++ b/crawl-ref/source/Makefile @@ -482,10 +482,11 @@ else CFLAGS_ARCH := -arch $(MARCH) 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) From 6a9bbea1006aa68d8f211b739ffa1fa85468492c Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Fri, 16 Mar 2018 15:07:03 +1100 Subject: [PATCH 3/7] Pull in the latest Makefile from vanilla --- crawl-ref/source/Makefile | 119 +++++++++++--------------------------- 1 file changed, 34 insertions(+), 85 deletions(-) diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile index f1f680763ae..ef07aa54897 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 @@ -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,7 +417,7 @@ 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 MACOSX_MIN_VERSION=10.7 @@ -761,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 @@ -783,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) @@ -1080,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 $@; @@ -1204,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 @@ -1334,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 @@ -1346,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 $< $@ @@ -1430,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 @@ -1446,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 @@ -1655,7 +1604,7 @@ $(RLTILES)/dc-unrand.txt: art-data.h artefact.o: art-data.h art-enum.h mon-util.o: mon-mst.h mon-util.d: mon-mst.h -l_moninf.o: mi-enum.h +l-moninf.o: mi-enum.h macro.o: cmd-name.h ############################################################################# From a0cf6f08bcff6a43f38a53f5b953d3bec0d7a5e7 Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Fri, 16 Mar 2018 01:49:34 +1100 Subject: [PATCH 4/7] Remove Fighting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The big change is how HP is calculated: - // 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; + hitp += (you.experience_level * you.experience_level * 3) / 70 + + (you.experience_level * 3 / 2); What does this change do in practice? 🤷 Lots of other things have changed: * Fighting with a weird weapon uses Unarmed Combat skill now * Double the to-hit contribution from weapon skill (weapons) * Increase the to-hit contribution from Dex (unarmed only) * Probably completely broke Wanderers * Dith shadow mimic HD now gets bonus equal to piety rank to make up for not getting fighting. --- crawl-ref/source/acquire.cc | 6 +- crawl-ref/source/aptitudes.h | 94 ++++++++++++++-------------- crawl-ref/source/attack.cc | 27 ++------- crawl-ref/source/attack.h | 1 - crawl-ref/source/contrib/sdl2 | 2 +- crawl-ref/source/contrib/sqlite | 2 +- crawl-ref/source/describe.cc | 5 +- crawl-ref/source/exercise.cc | 8 +-- crawl-ref/source/ghost.cc | 7 +-- crawl-ref/source/godpassive.cc | 2 +- crawl-ref/source/hints.cc | 1 - crawl-ref/source/itemprop.cc | 18 +++--- crawl-ref/source/items.cc | 2 +- crawl-ref/source/job-data.h | 22 +++---- crawl-ref/source/l_item.cc | 2 +- crawl-ref/source/melee_attack.cc | 38 ++++++------ crawl-ref/source/mon-info.cc | 4 +- crawl-ref/source/ng-wanderer.cc | 42 +------------ crawl-ref/source/ouch.cc | 6 +- crawl-ref/source/player-equip.cc | 16 ++--- crawl-ref/source/player.cc | 101 +++++++++++++++---------------- crawl-ref/source/skills.cc | 19 ------ 22 files changed, 165 insertions(+), 260 deletions(-) diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc index 607b908e4a8..194a06959c0 100644 --- a/crawl-ref/source/acquire.cc +++ b/crawl-ref/source/acquire.cc @@ -426,7 +426,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 @@ -627,7 +627,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) @@ -985,7 +985,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. if (agent != GOD_XOM) diff --git a/crawl-ref/source/aptitudes.h b/crawl-ref/source/aptitudes.h index 0dc74d4d175..5c9c221ceb7 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), @@ -206,7 +206,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = #endif // 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), @@ -247,7 +247,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_HILL_ORC, 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), @@ -288,7 +288,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), @@ -329,7 +329,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), @@ -370,7 +370,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), @@ -411,7 +411,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), @@ -452,7 +452,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), @@ -493,7 +493,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), @@ -534,7 +534,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), @@ -575,7 +575,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), @@ -616,7 +616,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), @@ -657,7 +657,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), @@ -698,7 +698,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), @@ -740,7 +740,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), @@ -776,7 +776,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), @@ -817,7 +817,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), @@ -858,7 +858,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), @@ -894,7 +894,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), @@ -933,9 +933,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), @@ -974,9 +974,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), @@ -1017,7 +1017,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), @@ -1058,7 +1058,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), @@ -1099,7 +1099,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), @@ -1140,7 +1140,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_DEMONSPAWN, SK_EVOCATIONS, 0), // 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), @@ -1181,7 +1181,7 @@ static const species_skill_aptitude species_skill_aptitudes[] = APT(SP_GHOUL, SK_EVOCATIONS, -1), // SP_TENGU - APT(SP_TENGU, SK_FIGHTING, 0), + APT(SP_TENGU, SK_FIGHTING, UNUSABLE_SKILL), APT(SP_TENGU, SK_SHORT_BLADES, 1), APT(SP_TENGU, SK_LONG_BLADES, UNUSABLE_SKILL), APT(SP_TENGU, SK_AXES, 1), @@ -1222,7 +1222,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), @@ -1263,7 +1263,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), @@ -1305,7 +1305,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), @@ -1340,7 +1340,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), @@ -1374,9 +1374,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), @@ -1418,7 +1418,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), @@ -1453,7 +1453,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), @@ -1489,7 +1489,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), @@ -1530,7 +1530,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), @@ -1569,10 +1569,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), @@ -1607,7 +1607,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), @@ -1644,9 +1644,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 b9c996814f8..309b9d66a58 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -159,20 +159,14 @@ 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) - { - if (you.skill(wpn_skill) < 1 && player_in_a_dangerous_place()) - xom_is_stimulated(10); // Xom thinks that is mildly amusing. + if (you.skill(wpn_skill) < 1 && player_in_a_dangerous_place()) + xom_is_stimulated(10); // Xom thinks that is mildly amusing. - 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); @@ -354,8 +348,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); @@ -1192,16 +1184,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; @@ -1345,7 +1327,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 8acc88e4634..552c53050cc 100644 --- a/crawl-ref/source/attack.h +++ b/crawl-ref/source/attack.h @@ -188,7 +188,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 0933bf230bc..0861942c1a9 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1237,10 +1237,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 4246e1bf251..d2585455de7 100644 --- a/crawl-ref/source/godpassive.cc +++ b/crawl-ref/source/godpassive.cc @@ -1231,7 +1231,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 ab25d8be749..66f2feb1d44 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 a1f6036c34f..5a3cef55581 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1418,7 +1418,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) @@ -1457,7 +1457,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; @@ -1590,11 +1590,11 @@ int wand_charge_value(int type) return 4; default: - return 5; + return 5; case WAND_FLAME: case WAND_CONFUSION: - return 6; + return 6; } } @@ -1924,7 +1924,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) { @@ -1936,7 +1936,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; } /** @@ -1945,7 +1945,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) { @@ -2024,7 +2024,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(); @@ -2838,7 +2838,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 690108de458..16e2f6ee02f 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -4538,7 +4538,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 8dba1ee5409..670a9f6c7db 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_HILL_ORC, 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_HILL_ORC, 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_HILL_ORC, 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_HILL_ORC, 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_HILL_ORC, 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, }, { "arrow q:96", "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 c97a4761c88..1aeae71ed57 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(); } @@ -370,24 +370,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)) @@ -802,7 +802,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; @@ -1185,7 +1185,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())) { @@ -1319,8 +1319,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); @@ -1417,7 +1415,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 "; } @@ -1830,7 +1828,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; @@ -2029,7 +2027,7 @@ void melee_attack::apply_staff_damage() } std::string d = std::to_string(0); - + switch (weapon->sub_type) { case STAFF_AIR: @@ -2376,7 +2374,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); @@ -2669,7 +2667,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); @@ -2681,7 +2679,7 @@ void melee_attack::mons_apply_attack_flavour() "mutagenic touch"); } break; - + case AF_PARALYSE: { // Only wasps at the moment, so Zin vitalisation @@ -3159,7 +3157,7 @@ void melee_attack::do_minotaur_retaliation() if(!defender->airborne()) return; } - + if (!defender->is_player()) { // monsters have no STR or DEX @@ -3205,7 +3203,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); @@ -3378,7 +3375,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)) { @@ -3439,8 +3436,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 5d16663cf6e..fc213791eb6 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); @@ -1349,7 +1349,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 93ede959b2f..739f04545dc 100644 --- a/crawl-ref/source/ng-wanderer.cc +++ b/crawl-ref/source/ng-wanderer.cc @@ -118,7 +118,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); @@ -127,7 +127,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; @@ -438,23 +438,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: @@ -471,7 +454,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; @@ -527,25 +510,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 3d57cbf53f2..3267d75081f 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -506,8 +506,6 @@ static void _xom_checks_damage(kill_method_type death_type, { amusementvalue += 2; } - else if (you.skill(SK_FIGHTING) <= (you.experience_level / 4)) - amusementvalue += 2; if (player_in_a_dangerous_place()) amusementvalue += 2; @@ -761,7 +759,7 @@ int do_shave_damage(int dam) { if (!can_shave_damage()) return dam; - + if (dam == 0) return dam; @@ -923,7 +921,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 1b07e4ad956..e77753e32c6 100644 --- a/crawl-ref/source/player-equip.cc +++ b/crawl-ref/source/player-equip.cc @@ -383,7 +383,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; xom_is_stimulated(amusement); @@ -490,7 +490,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; @@ -829,7 +829,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(); @@ -983,7 +983,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(); @@ -1069,8 +1069,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; } @@ -1173,7 +1173,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(); @@ -1267,7 +1267,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 3eb8d6f1ce3..181c23d52e1 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -222,7 +222,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))) { @@ -245,7 +245,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]) { @@ -458,7 +458,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) @@ -477,7 +477,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; @@ -597,9 +597,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; } @@ -702,7 +702,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)) { @@ -1408,7 +1408,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; @@ -1772,7 +1772,7 @@ int player_spec_fire() if (you.duration[DUR_FIRE_SHIELD]) sf++; - + if (you.attribute[ATTR_FIRE_SHIELD]) sf++; @@ -1786,7 +1786,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: @@ -1810,7 +1810,7 @@ int player_spec_earth() // Staves se += you.wearing(EQ_SHIELD, STAFF_EARTH); - + // Earth enhancer goodmut se += you.get_mutation_level(MUT_EARTH_ENHANCER); @@ -1823,7 +1823,7 @@ int player_spec_air() // Staves sa += you.wearing(EQ_SHIELD, STAFF_AIR); - + // Air enhancer goodmut sa += you.get_mutation_level(MUT_AIR_ENHANCER); @@ -1838,7 +1838,7 @@ int player_spec_conj() int player_spec_hex() { int sh = 0; - + // Hex enhancer goodmut sh += you.get_mutation_level(MUT_HEX_ENHANCER); @@ -1860,7 +1860,7 @@ int player_spec_summ() // Staves ss += you.wearing(EQ_SHIELD, STAFF_SUMMONING); - + // Summon enhancer goodmut ss += you.get_mutation_level(MUT_SUMMON_ENHANCER); @@ -1933,7 +1933,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++; } @@ -2187,7 +2187,7 @@ static int _player_evasion_bonuses() // transformation penalties/bonuses not covered by size alone: if (you.get_mutation_level(MUT_SLOW_REFLEXES)) evbonus -= you.get_mutation_level(MUT_SLOW_REFLEXES) * 3; - + if (you.props.exists(WALL_JUMP_EV_KEY)) evbonus += you.props[WALL_JUMP_EV_KEY].get_int(); @@ -2378,7 +2378,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; @@ -2616,9 +2616,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) @@ -2639,7 +2639,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) @@ -2699,7 +2699,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) @@ -2713,7 +2713,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); @@ -3200,7 +3200,7 @@ int check_stealth() if (you.duration[DUR_AGILITY]) stealth += STEALTH_PIP; - + if (cloak && get_armour_ego_type(*cloak) == SPARM_STEALTH) stealth += STEALTH_PIP; @@ -3222,7 +3222,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 @@ -3269,7 +3269,7 @@ int check_stealth() stealth *= umbra_mul; stealth /= umbra_div; } - + if (you.form == TRAN_SHADOW) stealth *= 2; @@ -3640,14 +3640,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; } @@ -4044,9 +4044,8 @@ int get_real_hp(bool trans, bool rotted) hitp = you.experience_level * 11 / 2 + 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; + hitp += (you.experience_level * you.experience_level * 3) / 70 + + (you.experience_level * 3 / 2); // Racial modifier. hitp *= 10 + species_hp_modifier(you.species); @@ -4112,12 +4111,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); @@ -4277,7 +4276,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!"); @@ -4290,13 +4289,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) @@ -4316,7 +4315,7 @@ bool confuse_player(int amount, bool quiet, bool force) xom_is_stimulated((you.duration[DUR_CONF]) / BASELINE_DELAY); - + return true; } @@ -4337,7 +4336,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."); @@ -4357,7 +4356,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); @@ -4678,7 +4677,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."); @@ -5186,7 +5185,7 @@ player::player() obtainable_runes = 15; spell_library.reset(); - + spells.init(SPELL_NO_SPELL); old_vehumet_gifts.clear(); spell_no = 0; @@ -5778,7 +5777,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) @@ -5928,7 +5927,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; } @@ -5944,7 +5943,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; @@ -6435,7 +6434,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; @@ -6699,7 +6698,7 @@ void player::drain_stat(stat_type s, int amount) simple_god_message(" protects you from stat loss."); return; } - + lose_stat(s, amount); } @@ -6715,7 +6714,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."); @@ -6793,7 +6792,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) @@ -6880,7 +6879,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."); @@ -7107,7 +7106,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."); @@ -7166,7 +7165,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(); } @@ -7714,7 +7713,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 e4101746a77..34c97f789ce 100644 --- a/crawl-ref/source/skills.cc +++ b/crawl-ref/source/skills.cc @@ -307,19 +307,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; @@ -1829,17 +1821,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) From ee49e646f4ed0650b5b64926f88c2f55ebf8ffd4 Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Fri, 16 Mar 2018 16:06:47 +1100 Subject: [PATCH 5/7] Revert a part of the Makefile update Hellcrawl doesn't have the commit that renames l_moninf.o --- crawl-ref/source/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile index ef07aa54897..2b96fc70e58 100644 --- a/crawl-ref/source/Makefile +++ b/crawl-ref/source/Makefile @@ -1604,7 +1604,7 @@ $(RLTILES)/dc-unrand.txt: art-data.h artefact.o: art-data.h art-enum.h mon-util.o: mon-mst.h mon-util.d: mon-mst.h -l-moninf.o: mi-enum.h +l_moninf.o: mi-enum.h macro.o: cmd-name.h ############################################################################# From 587f89750a38ac67bf723cbdcd4a02a772115e93 Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Wed, 21 Mar 2018 23:45:00 +1100 Subject: [PATCH 6/7] Simplify max HP calculation further To `6 + (you.experience_level * 8)`. The results barely change, but the formula is much more comprehensible. --- crawl-ref/source/player.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 181c23d52e1..6176b6a7454 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4042,10 +4042,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; - hitp += (you.experience_level * you.experience_level * 3) / 70 - + (you.experience_level * 3 / 2); // Racial modifier. hitp *= 10 + species_hp_modifier(you.species); From e513103fa1d1212a966028352874af50cc93248c Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Tue, 25 Sep 2018 17:13:17 +1000 Subject: [PATCH 7/7] Remove Fighting from MDs --- crawl-ref/source/aptitudes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/aptitudes.h b/crawl-ref/source/aptitudes.h index 5451f0c46fd..3d2e8e5b320 100644 --- a/crawl-ref/source/aptitudes.h +++ b/crawl-ref/source/aptitudes.h @@ -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),