From bcc1f0586c6beaa29100f7d18fc54c49a14608ea Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 16 Dec 2020 10:06:14 +0100 Subject: [PATCH 01/20] Update Travis badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9108077ff..7895e63ad 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/diasurgical/devilution.svg?branch=master)](https://travis-ci.org/diasurgical/devilution) +[![Build Status](https://www.travis-ci.com/diasurgical/devilution.svg?branch=master)](https://www.travis-ci.com/diasurgical/devilution) [![Build status](https://ci.appveyor.com/api/projects/status/ssk0xjhoka1uu940?svg=true)](https://ci.appveyor.com/project/galaxyhaxz/devilution) [![Build status](https://img.shields.io/github/downloads/diasurgical/devilution/total.svg)](https://github.com/diasurgical/devilution/releases) [![github stars](https://img.shields.io/github/stars/diasurgical/devilution.svg)](https://github.com/diasurgical/devilution/stargazers) From 42c747d7e95900b713a8c405295803ef44bf07aa Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 04:42:36 +0100 Subject: [PATCH 02/20] Migrate Linux builds to CircleCI --- .circleci/config.yml | 67 +++++++++++++++++++++++++++++++++++++ .travis.yml | 78 -------------------------------------------- 2 files changed, 67 insertions(+), 78 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..2e82ccd82 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,67 @@ +version: 2 +jobs: + diablo_109b: + docker: + - image: diasurgical/riivaaja:stable + working_directory: ~/repo + steps: + - checkout + - run: make -f MakefileVC + diablo_109b_diff: + docker: + - image: diasurgical/riivaaja:stable + environment: + MAKE_BUILD: pdb + working_directory: ~/repo + steps: + - checkout + - run: make -f MakefileVC + - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: mv comparer-config/diablo.toml comparer-config.toml + - run: ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + - run: ../status.sh + - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" + spawn_109b_diff: + docker: + - image: diasurgical/riivaaja:stable + environment: + MAKE_BUILD: pdb + SPAWN: 1 + working_directory: ~/repo + steps: + - checkout + - run: make -f MakefileVC + - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: mv comparer-config/spawn.toml comparer-config.toml + - run: ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + - run: ../spawn-status.sh + - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" + hellfire_101_diff: + docker: + - image: diasurgical/riivaaja:stable + environment: + MAKE_BUILD: pdb + HELLFIRE: 1 + working_directory: ~/repo + steps: + - checkout + - run: make -f MakefileVC + - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + - run: dd if=/dev/zero bs=1 count=3072 of=hellfire.exe + - run: dd if=Diablo.exe >> hellfire.exe + - run: mv comparer-config/hellfire.toml comparer-config.toml + - run: ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original + - run: ../hellfire-status.sh + - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" + +workflows: + version: 2 + testflow: + jobs: + - diablo_109b + - diablo_109b_diff + - spawn_109b_diff + - hellfire_101_diff diff --git a/.travis.yml b/.travis.yml index e5a6d762e..43cfbbbba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: cpp os: - - linux - osx osx_image: xcode11.3 @@ -11,9 +10,6 @@ notifications: on_failure: change # default: always addons: - apt: - packages: - - mingw-w64 homebrew: packages: - mingw-w64 @@ -26,78 +22,4 @@ script: - if [ $MAKE_BUILD = debug ]; then make debug; fi stages: - - Riivaaja - test - -jobs: - include: - - stage: Riivaaja - name: "Diablo 1.09b: original toolchain" - language: minimal - sudo: required - services: - - docker - addons: {} - script: docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable - - stage: Riivaaja - name: "Diablo 1.09b: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/diablo.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja:stable - ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" - - stage: Riivaaja - name: "Spawn 1.09: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/spawn.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e SPAWN=1 diasurgical/riivaaja:stable - ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../spawn-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" - - stage: Riivaaja - name: "Hellfire 1.01: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/hellfire.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e HELLFIRE=1 diasurgical/riivaaja:stable - dd if=/dev/zero bs=1 count=3072 of=hellfire.exe - dd if=Diablo.exe >> hellfire.exe - ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../hellfire-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" From 39efaf13126f03dc0147c56d453ab6edf3e81bce Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 04:57:56 +0100 Subject: [PATCH 03/20] Add Linux mingw based builds --- .circleci/config.yml | 57 +++++--------------------------------- .travis.yml | 66 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e82ccd82..c121c37cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,65 +3,22 @@ jobs: diablo_109b: docker: - image: diasurgical/riivaaja:stable - working_directory: ~/repo steps: - checkout - run: make -f MakefileVC - diablo_109b_diff: + linux: docker: - - image: diasurgical/riivaaja:stable - environment: - MAKE_BUILD: pdb - working_directory: ~/repo - steps: - - checkout - - run: make -f MakefileVC - - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: mv comparer-config/diablo.toml comparer-config.toml - - run: ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - - run: ../status.sh - - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" - spawn_109b_diff: - docker: - - image: diasurgical/riivaaja:stable - environment: - MAKE_BUILD: pdb - SPAWN: 1 - working_directory: ~/repo + - image: debian:stretch-backports steps: - checkout - - run: make -f MakefileVC - - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: mv comparer-config/spawn.toml comparer-config.toml - - run: ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - - run: ../spawn-status.sh - - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" - hellfire_101_diff: - docker: - - image: diasurgical/riivaaja:stable - environment: - MAKE_BUILD: pdb - HELLFIRE: 1 - working_directory: ~/repo - steps: - - checkout - - run: make -f MakefileVC - - run: wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - - run: dd if=/dev/zero bs=1 count=3072 of=hellfire.exe - - run: dd if=Diablo.exe >> hellfire.exe - - run: mv comparer-config/hellfire.toml comparer-config.toml - - run: ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original - - run: ../hellfire-status.sh - - run: .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" + - run: apt-get update -y + - run: apt-get install -y mingw-w64 + - run: make + - run: make debug workflows: version: 2 testflow: jobs: - diablo_109b - - diablo_109b_diff - - spawn_109b_diff - - hellfire_101_diff + - linux diff --git a/.travis.yml b/.travis.yml index 43cfbbbba..ba90725ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,70 @@ script: - if [ $MAKE_BUILD = debug ]; then make debug; fi stages: + - Riivaaja - test + +jobs: + include: + - stage: Riivaaja + name: "Diablo 1.09b: Calculate binary accuracy" + language: minimal + sudo: required + services: + - docker + addons: {} + script: + - | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/diablo.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja:stable + ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" + - stage: Riivaaja + name: "Spawn 1.09: Calculate binary accuracy" + language: minimal + sudo: required + services: + - docker + addons: {} + script: + - | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/spawn.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e SPAWN=1 diasurgical/riivaaja:stable + ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../spawn-status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" + - stage: Riivaaja + name: "Hellfire 1.01: Calculate binary accuracy" + language: minimal + sudo: required + services: + - docker + addons: {} + script: + - | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/hellfire.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e HELLFIRE=1 diasurgical/riivaaja:stable + dd if=/dev/zero bs=1 count=3072 of=hellfire.exe + dd if=Diablo.exe >> hellfire.exe + ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../hellfire-status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" From 8bf46e13e477dd67cea64545977f09302e0b5436 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 05:51:33 +0100 Subject: [PATCH 04/20] Add make to CI image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c121c37cc..10ef21212 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: steps: - checkout - run: apt-get update -y - - run: apt-get install -y mingw-w64 + - run: apt-get install -y mingw-w64 make - run: make - run: make debug From 59f6237ba963f59c77450366cd99d5e91c8b1b4b Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 06:16:03 +0100 Subject: [PATCH 05/20] Add diablo_109b_diff step to CircleCI --- .circleci/config.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10ef21212..8bd36dd6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,22 @@ jobs: steps: - checkout - run: make -f MakefileVC + diablo_109b_diff: + machine: true + steps: + - checkout + - run: | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/diablo.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja:stable + ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" linux: docker: - image: debian:stretch-backports @@ -21,4 +37,5 @@ workflows: testflow: jobs: - diablo_109b + - diablo_109b_diff - linux From 93565c03ad349879d0b29c297171af50d7b65e42 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 06:21:46 +0100 Subject: [PATCH 06/20] Move diff builds to CircleCI --- .circleci/config.yml | 36 ++++++++++++++++++++++++ .travis.yml | 66 -------------------------------------------- 2 files changed, 36 insertions(+), 66 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bd36dd6c..311171307 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,40 @@ jobs: ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" + spawn_109b_diff: + machine: true + steps: + - checkout + - run: | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/spawn.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e SPAWN=1 diasurgical/riivaaja:stable + ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../spawn-status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" + hellfire_101_diff: + machine: true + steps: + - checkout + - run: | + set -e + wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz + mv comparer-config/hellfire.toml comparer-config.toml + echo '#!/bin/sh' | sudo tee /bin/wine + echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine + sudo chmod +x /bin/wine + docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e HELLFIRE=1 diasurgical/riivaaja:stable + dd if=/dev/zero bs=1 count=3072 of=hellfire.exe + dd if=Diablo.exe >> hellfire.exe + ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original + docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../hellfire-status.sh + .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" linux: docker: - image: debian:stretch-backports @@ -38,4 +72,6 @@ workflows: jobs: - diablo_109b - diablo_109b_diff + - spawn_109b_diff + - hellfire_101_diff - linux diff --git a/.travis.yml b/.travis.yml index ba90725ed..43cfbbbba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,70 +22,4 @@ script: - if [ $MAKE_BUILD = debug ]; then make debug; fi stages: - - Riivaaja - test - -jobs: - include: - - stage: Riivaaja - name: "Diablo 1.09b: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/diablo.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja:stable - ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" - - stage: Riivaaja - name: "Spawn 1.09: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/spawn.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e SPAWN=1 diasurgical/riivaaja:stable - ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../spawn-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" - - stage: Riivaaja - name: "Hellfire 1.01: Calculate binary accuracy" - language: minimal - sudo: required - services: - - docker - addons: {} - script: - - | - set -e - wget https://github.com/diasurgical/devilution-comparer/releases/download/v0.4.0/devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - tar xf devilution-comparer-v0.4.0-x86_64-unknown-linux-gnu.tar.xz - mv comparer-config/hellfire.toml comparer-config.toml - echo '#!/bin/sh' | sudo tee /bin/wine - echo 'docker run -v $(pwd):/root/devilution --entrypoint "/usr/bin/wine" diasurgical/riivaaja:stable $(basename $1) $2 $3' | sudo tee --append /bin/wine - sudo chmod +x /bin/wine - docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e HELLFIRE=1 diasurgical/riivaaja:stable - dd if=/dev/zero bs=1 count=3072 of=hellfire.exe - dd if=Diablo.exe >> hellfire.exe - ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original - docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../hellfire-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" From 21d18d5c31526c2f079e3bc6b63998e4b1d6e13d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 03:50:55 +0100 Subject: [PATCH 07/20] [hellfire] SpawnOnePremium --- Source/items.cpp | 95 +++++++++++++++++++++++++++++++---- Source/items.h | 20 ++++---- Source/player.cpp | 6 +-- Source/player.h | 6 +-- comparer-config/hellfire.toml | 26 +++++----- 5 files changed, 113 insertions(+), 40 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index aa616c9b6..1a7f1c8e6 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -330,7 +330,7 @@ int premiumlvladd[SMITH_PREMIUM_ITEMS] = { }; #ifdef HELLFIRE -int items_4231CA(int i) +int get_ring_max_value(int i) { int j, res; @@ -347,7 +347,7 @@ int items_4231CA(int i) return res; } -int items_423230(int i) +int get_bow_max_value(int i) { int j, res; @@ -364,7 +364,7 @@ int items_423230(int i) return res; } -int items_423296(int i) +int get_staff_max_value(int i) { int j, res; @@ -381,7 +381,7 @@ int items_423296(int i) return res; } -int items_4232FC(int i) +int get_sword_max_value(int i) { int j, res; @@ -398,7 +398,7 @@ int items_4232FC(int i) return res; } -int items_423362(int i) +int get_helm_max_value(int i) { int j, res; @@ -415,7 +415,7 @@ int items_423362(int i) return res; } -int items_4233C8(int i) +int get_shield_max_value(int i) { int j, res; @@ -432,7 +432,7 @@ int items_4233C8(int i) return res; } -int items_42342E(int i) +int get_armor_max_value(int i) { int j, res; @@ -453,7 +453,7 @@ int items_42342E(int i) return res; } -int items_4234B2(int i) +int get_mace_max_value(int i) { int j, res; @@ -470,7 +470,7 @@ int items_4234B2(int i) return res; } -int items_423518(int i) +int get_amulet_max_value(int i) { int j, res; @@ -487,7 +487,7 @@ int items_423518(int i) return res; } -int items_42357E(int i) +int get_axe_max_value(int i) { int j, res; @@ -4971,6 +4971,31 @@ static void SpawnOnePremium(int i, int plvl) ItemStruct holditem; holditem = item[0]; + +#ifdef HELLFIRE + int ivalue; + int count = 0; + + int strength = get_max_strength(plr[myplr]._pClass); + int dexterity = get_max_dexterity(plr[myplr]._pClass); + int magic = get_max_magic(plr[myplr]._pClass); + + if (strength < plr[myplr]._pStrength) { + strength = plr[myplr]._pStrength; + } + strength *= 1.2; + + if (dexterity < plr[myplr]._pDexterity) { + dexterity = plr[myplr]._pDexterity; + } + dexterity *= 1.2; + + if (magic < plr[myplr]._pMagic) { + magic = plr[myplr]._pMagic; + } + magic *= 1.2; +#endif + if (plvl > 30) plvl = 30; if (plvl < 1) @@ -4981,11 +5006,59 @@ static void SpawnOnePremium(int i, int plvl) itype = RndPremiumItem(plvl >> 2, plvl) - 1; GetItemAttrs(0, itype, plvl); #ifdef HELLFIRE - GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, FALSE); + GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, noSpells); #else GetItemBonus(0, itype, plvl >> 1, plvl, TRUE); #endif + +#ifdef HELLFIRE + ivalue = 0; + switch (item[0]._itype) { + case ITYPE_LARMOR: + case ITYPE_MARMOR: + case ITYPE_HARMOR: + ivalue = get_armor_max_value(myplr); + break; + case ITYPE_SHIELD: + ivalue = get_shield_max_value(myplr); + break; + case ITYPE_AXE: + ivalue = get_axe_max_value(myplr); + break; + case ITYPE_BOW: + ivalue = get_bow_max_value(myplr); + break; + case ITYPE_MACE: + ivalue = get_mace_max_value(myplr); + break; + case ITYPE_SWORD: + ivalue = get_sword_max_value(myplr); + break; + case ITYPE_HELM: + ivalue = get_helm_max_value(myplr); + break; + case ITYPE_STAFF: + ivalue = get_staff_max_value(myplr); + break; + case ITYPE_RING: + ivalue = get_ring_max_value(myplr); + break; + case ITYPE_AMULET: + ivalue = get_amulet_max_value(myplr); + break; + } + ivalue *= 0.8; + + count++; + } while ((item[0]._iIvalue > SMITH_MAX_PREMIUM_VALUE + || item[0]._iMinStr > strength + || item[0]._iMinMag > magic + || item[0]._iMinDex > dexterity + || item[0]._iIvalue < ivalue) + && count < 150); +#else } while (item[0]._iIvalue > SMITH_MAX_PREMIUM_VALUE); +#endif premiumitem[i] = item[0]; premiumitem[i]._iCreateInfo = plvl | CF_SMITHPREMIUM; premiumitem[i]._iIdentified = TRUE; diff --git a/Source/items.h b/Source/items.h index 2803c20c2..79dc450ca 100644 --- a/Source/items.h +++ b/Source/items.h @@ -21,16 +21,16 @@ extern int auricGold; extern int numitems; #ifdef HELLFIRE -int items_4231CA(int i); -int items_423230(int i); -int items_423296(int i); -int items_4232FC(int i); -int items_423362(int i); -int items_4233C8(int i); -int items_42342E(int i); -int items_4234B2(int i); -int items_423518(int i); -int items_42357E(int i); +int get_ring_max_value(int i); +int get_bow_max_value(int i); +int get_staff_max_value(int i); +int get_sword_max_value(int i); +int get_helm_max_value(int i); +int get_shield_max_value(int i); +int get_armor_max_value(int i); +int get_mace_max_value(int i); +int get_amulet_max_value(int i); +int get_axe_max_value(int i); #endif void InitItemGFX(); void InitItems(); diff --git a/Source/player.cpp b/Source/player.cpp index a35dc1ce2..e08c20c1d 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -4725,17 +4725,17 @@ void PlayDungMsgs() } #ifdef HELLFIRE -int player_45EFA1(int i) +int get_max_strength(int i) { return MaxStats[i][ATTRIB_STR]; } -int player_45EFAB(int i) +int get_max_magic(int i) { return MaxStats[i][ATTRIB_MAG]; } -int player_45EFB5(int i) +int get_max_dexterity(int i) { return MaxStats[i][ATTRIB_DEX]; } diff --git a/Source/player.h b/Source/player.h index 1b3c484f0..ca360036d 100644 --- a/Source/player.h +++ b/Source/player.h @@ -71,9 +71,9 @@ void SetPlrVit(int p, int v); void InitDungMsgs(int pnum); void PlayDungMsgs(); #ifdef HELLFIRE -int player_45EFA1(int i); -int player_45EFAB(int i); -int player_45EFB5(int i); +int get_max_strength(int i); +int get_max_magic(int i); +int get_max_dexterity(int i); #endif /* data */ diff --git a/comparer-config/hellfire.toml b/comparer-config/hellfire.toml index d6617b503..8261073dd 100644 --- a/comparer-config/hellfire.toml +++ b/comparer-config/hellfire.toml @@ -2823,52 +2823,52 @@ addr = 0x42319C size = 0x2E [[func]] -name = "items_4231CA" +name = "get_ring_max_value" addr = 0x4231CA size = 0x66 [[func]] -name = "items_423230" +name = "get_bow_max_value" addr = 0x423230 size = 0x66 [[func]] -name = "items_423296" +name = "get_staff_max_value" addr = 0x423296 size = 0x66 [[func]] -name = "items_4232FC" +name = "get_sword_max_value" addr = 0x4232FC size = 0x66 [[func]] -name = "items_423362" +name = "get_helm_max_value" addr = 0x423362 size = 0x66 [[func]] -name = "items_4233C8" +name = "get_shield_max_value" addr = 0x4233C8 size = 0x66 [[func]] -name = "items_42342E" +name = "get_armor_max_value" addr = 0x42342E size = 0x84 [[func]] -name = "items_4234B2" +name = "get_mace_max_value" addr = 0x4234B2 size = 0x66 [[func]] -name = "items_423518" +name = "get_amulet_max_value" addr = 0x423518 size = 0x66 [[func]] -name = "items_42357E" +name = "get_axe_max_value" addr = 0x42357E size = 0x66 @@ -8048,17 +8048,17 @@ addr = 0x45EB94 size = 0x40D [[func]] -name = "player_45EFA1" +name = "get_max_strength" addr = 0x45EFA1 size = 0xA [[func]] -name = "player_45EFAB" +name = "get_max_magic" addr = 0x45EFAB size = 0xA [[func]] -name = "player_45EFB5" +name = "get_max_dexterity" addr = 0x45EFB5 size = 0xA From e80d87a9bc755f96ce4908a05e719f18b95ab2ba Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 01:54:55 +0100 Subject: [PATCH 08/20] [hellfire] UseItem --- Source/items.cpp | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 1a7f1c8e6..97e829f34 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -4562,9 +4562,17 @@ void UseItem(int p, int Mid, int spl) case IMISC_MEAT: j = plr[p]._pMaxHP >> 8; l = ((j >> 1) + random_(39, j)) << 6; +#ifdef HELLFIRE + if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN) +#else if (plr[p]._pClass == PC_WARRIOR) - l *= 2; +#endif + l <<= 1; +#ifdef HELLFIRE + if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) +#else if (plr[p]._pClass == PC_ROGUE) +#endif l += l >> 1; plr[p]._pHitPoints += l; if (plr[p]._pHitPoints > plr[p]._pMaxHP) @@ -4583,8 +4591,12 @@ void UseItem(int p, int Mid, int spl) j = plr[p]._pMaxMana >> 8; l = ((j >> 1) + random_(40, j)) << 6; if (plr[p]._pClass == PC_SORCERER) - l *= 2; + l <<= 1; +#ifdef HELLFIRE + if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) +#else if (plr[p]._pClass == PC_ROGUE) +#endif l += l >> 1; if (!(plr[p]._pIFlags & ISPL_NOMANA)) { plr[p]._pMana += l; @@ -4608,18 +4620,32 @@ void UseItem(int p, int Mid, int spl) break; case IMISC_ELIXMAG: ModifyPlrMag(p, 1); +#ifdef HELLFIRE + plr[p]._pMana = plr[p]._pMaxMana; + plr[p]._pManaBase = plr[p]._pMaxManaBase; + drawmanaflag = TRUE; +#endif break; case IMISC_ELIXDEX: ModifyPlrDex(p, 1); break; case IMISC_ELIXVIT: ModifyPlrVit(p, 1); +#ifdef HELLFIRE + plr[p]._pHitPoints = plr[p]._pMaxHP; + plr[p]._pHPBase = plr[p]._pMaxHPBase; + drawhpflag = TRUE; +#endif break; case IMISC_REJUV: j = plr[p]._pMaxHP >> 8; l = ((j >> 1) + random_(39, j)) << 6; +#ifdef HELLFIRE + if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN) +#else if (plr[p]._pClass == PC_WARRIOR) - l *= 2; +#endif + l <<= 1; if (plr[p]._pClass == PC_ROGUE) l += l >> 1; plr[p]._pHitPoints += l; @@ -4632,7 +4658,7 @@ void UseItem(int p, int Mid, int spl) j = plr[p]._pMaxMana >> 8; l = ((j >> 1) + random_(40, j)) << 6; if (plr[p]._pClass == PC_SORCERER) - l *= 2; + l <<= 1; if (plr[p]._pClass == PC_ROGUE) l += l >> 1; if (!(plr[p]._pIFlags & ISPL_NOMANA)) { @@ -4729,7 +4755,7 @@ void UseItem(int p, int Mid, int spl) if (!invflag) { invflag = TRUE; } - SetCursor_(CURSOR_OIL); + NewCursor(CURSOR_OIL); break; #endif case IMISC_SPECELIX: @@ -4743,31 +4769,31 @@ void UseItem(int p, int Mid, int spl) plr[p]._pTSpell = SPL_RUNEFIRE; plr[p]._pTSplType = RSPLTYPE_INVALID; if (p == myplr) - SetCursor_(CURSOR_TELEPORT); + NewCursor(CURSOR_TELEPORT); break; case IMISC_RUNEL: plr[p]._pTSpell = SPL_RUNELIGHT; plr[p]._pTSplType = RSPLTYPE_INVALID; if (p == myplr) - SetCursor_(CURSOR_TELEPORT); + NewCursor(CURSOR_TELEPORT); break; case IMISC_GR_RUNEL: plr[p]._pTSpell = SPL_RUNENOVA; plr[p]._pTSplType = RSPLTYPE_INVALID; if (p == myplr) - SetCursor_(CURSOR_TELEPORT); + NewCursor(CURSOR_TELEPORT); break; case IMISC_GR_RUNEF: plr[p]._pTSpell = SPL_RUNEIMMOLAT; plr[p]._pTSplType = RSPLTYPE_INVALID; if (p == myplr) - SetCursor_(CURSOR_TELEPORT); + NewCursor(CURSOR_TELEPORT); break; case IMISC_RUNES: plr[p]._pTSpell = SPL_RUNESTONE; plr[p]._pTSplType = RSPLTYPE_INVALID; if (p == myplr) - SetCursor_(CURSOR_TELEPORT); + NewCursor(CURSOR_TELEPORT); break; #endif } From a23e039412a1838f3c77719e4de8c4ca265c1533 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 26 Dec 2020 19:54:59 +0100 Subject: [PATCH 09/20] Clean up PrintItemPower --- Source/items.cpp | 78 ++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 97e829f34..67870c2fd 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3781,7 +3781,7 @@ void PrintItemOil(char IDidx) switch (IDidx) { #ifdef HELLFIRE case IMISC_OILACC: - strcpy(tempstr, "increases a weapon\'s"); + strcpy(tempstr, "increases a weapon's"); AddPanelString(tempstr, TRUE); strcpy(tempstr, "chance to hit"); AddPanelString(tempstr, TRUE); @@ -3789,17 +3789,17 @@ void PrintItemOil(char IDidx) case IMISC_OILMAST: strcpy(tempstr, "greatly increases a"); AddPanelString(tempstr, TRUE); - strcpy(tempstr, "weapon\'s chance to hit"); + strcpy(tempstr, "weapon's chance to hit"); AddPanelString(tempstr, TRUE); break; case IMISC_OILSHARP: - strcpy(tempstr, "increases a weapon\'s"); + strcpy(tempstr, "increases a weapon's"); AddPanelString(tempstr, TRUE); strcpy(tempstr, "damage potential"); AddPanelString(tempstr, TRUE); break; case IMISC_OILDEATH: - strcpy(tempstr, "greatly increases a weapon\'s"); + strcpy(tempstr, "greatly increases a weapon's"); AddPanelString(tempstr, TRUE); strcpy(tempstr, "damage potential - not bows"); AddPanelString(tempstr, TRUE); @@ -3813,11 +3813,11 @@ void PrintItemOil(char IDidx) case IMISC_OILBSMTH: strcpy(tempstr, "restores 20% of an"); AddPanelString(tempstr, TRUE); - strcpy(tempstr, "item\'s durability"); + strcpy(tempstr, "item's durability"); AddPanelString(tempstr, TRUE); break; case IMISC_OILFORT: - strcpy(tempstr, "increases an item\'s"); + strcpy(tempstr, "increases an item's"); AddPanelString(tempstr, TRUE); strcpy(tempstr, "current and max durability"); AddPanelString(tempstr, TRUE); @@ -3939,9 +3939,6 @@ void PrintItemPower(char plidx, ItemStruct *x) break; case IPL_TOHIT_DAMP: case IPL_TOHIT_DAMP_CURSE: -#ifdef HELLFIRE - case IPL_DOPPELGANGER: -#endif sprintf(tempstr, "to hit: %+i%%, %+i%% damage", x->_iPLToHit, x->_iPLDam); break; case IPL_ACP: @@ -3960,7 +3957,11 @@ void PrintItemPower(char plidx, ItemStruct *x) #endif if (x->_iPLFR < 75) sprintf(tempstr, "Resist Fire : %+i%%", x->_iPLFR); +#ifdef HELLFIRE + else +#else if (x->_iPLFR >= 75) +#endif sprintf(tempstr, "Resist Fire : 75%% MAX"); break; case IPL_LIGHTRES: @@ -3969,7 +3970,11 @@ void PrintItemPower(char plidx, ItemStruct *x) #endif if (x->_iPLLR < 75) sprintf(tempstr, "Resist Lightning : %+i%%", x->_iPLLR); +#ifdef HELLFIRE + else +#else if (x->_iPLLR >= 75) +#endif sprintf(tempstr, "Resist Lightning : 75%% MAX"); break; case IPL_MAGICRES: @@ -3978,7 +3983,11 @@ void PrintItemPower(char plidx, ItemStruct *x) #endif if (x->_iPLMR < 75) sprintf(tempstr, "Resist Magic : %+i%%", x->_iPLMR); +#ifdef HELLFIRE + else +#else if (x->_iPLMR >= 75) +#endif sprintf(tempstr, "Resist Magic : 75%% MAX"); break; case IPL_ALLRES: @@ -3994,18 +4003,19 @@ void PrintItemPower(char plidx, ItemStruct *x) if (x->_iSplLvlAdd == 1) strcpy(tempstr, "spells are increased 1 level"); #ifdef HELLFIRE - if (x->_iSplLvlAdd > 1) + else if (x->_iSplLvlAdd > 1) sprintf(tempstr, "spells are increased %i levels", x->_iSplLvlAdd); + else if (x->_iSplLvlAdd == -1) #else if (x->_iSplLvlAdd == 2) strcpy(tempstr, "spells are increased 2 levels"); -#endif if (x->_iSplLvlAdd < 1) +#endif strcpy(tempstr, "spells are decreased 1 level"); #ifdef HELLFIRE - if (x->_iSplLvlAdd < -1) - sprintf(tempstr, "spells are decreased %i levels", x->_iSplLvlAdd); - if (x->_iSplLvlAdd == 0) + else if (x->_iSplLvlAdd < -1) + sprintf(tempstr, "spells are decreased %i levels", -x->_iSplLvlAdd); + else if (x->_iSplLvlAdd == 0) strcpy(tempstr, "spell levels unchanged (?)"); #endif break; @@ -4080,7 +4090,7 @@ void PrintItemPower(char plidx, ItemStruct *x) break; #ifdef HELLFIRE case IPL_MULT_ARROWS: - strcpy(tempstr, "multiple arrows per shot"); + sprintf(tempstr, "multiple arrows per shot"); break; #endif case IPL_FIRE_ARROWS: @@ -4099,6 +4109,14 @@ void PrintItemPower(char plidx, ItemStruct *x) #endif sprintf(tempstr, "lightning arrows damage %i-%i", x->_iLMinDam, x->_iLMaxDam); break; +#ifdef HELLFIRE + case IPL_FIREBALL: + if (x->_iFMinDam == x->_iFMaxDam) + sprintf(tempstr, "fireball damage: %i", x->_iFMinDam); + else + sprintf(tempstr, "fireball damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); + break; +#endif case IPL_THORNS: strcpy(tempstr, "attacker takes 1-3 damage"); break; @@ -4108,14 +4126,6 @@ void PrintItemPower(char plidx, ItemStruct *x) case IPL_NOHEALPLR: strcpy(tempstr, "you can't heal"); break; -#ifdef HELLFIRE - case IPL_FIREBALL: - if (x->_iFMinDam != x->_iFMaxDam) - sprintf(tempstr, "fireball damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); - else - sprintf(tempstr, "fireball damage: %i", x->_iFMinDam); - break; -#endif case IPL_ABSHALFTRAP: strcpy(tempstr, "absorbs half of trap damage"); break; @@ -4145,7 +4155,7 @@ void PrintItemPower(char plidx, ItemStruct *x) break; case IPL_TARGAC: #ifdef HELLFIRE - strcpy(tempstr, "penetrates target\'s armor"); + strcpy(tempstr, "penetrates target's armor"); #else strcpy(tempstr, "damages target's armor"); #endif @@ -4206,11 +4216,10 @@ void PrintItemPower(char plidx, ItemStruct *x) break; case IPL_ADDACLIFE: #ifdef HELLFIRE - if (x->_iFMinDam != x->_iFMaxDam) { - sprintf(tempstr, "lightning: %i-%i", x->_iFMinDam, x->_iFMaxDam); - break; - } - sprintf(tempstr, "lightning damage: %i", x->_iFMinDam); + if (x->_iFMinDam == x->_iFMaxDam) + sprintf(tempstr, "lightning damage: %i", x->_iFMinDam); + else + sprintf(tempstr, "lightning damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); #else strcpy(tempstr, "Armor class added to life"); #endif @@ -4244,17 +4253,20 @@ void PrintItemPower(char plidx, ItemStruct *x) case IPL_CRYSTALLINE: sprintf(tempstr, "low dur, %+i%% damage", x->_iPLDam); break; + case IPL_DOPPELGANGER: + sprintf(tempstr, "to hit: %+i%%, %+i%% damage", x->_iPLToHit, x->_iPLDam); + break; case IPL_ACDEMON: - strcpy(tempstr, "extra AC vs demons"); + sprintf(tempstr, "extra AC vs demons"); break; case IPL_ACUNDEAD: - strcpy(tempstr, "extra AC vs undead"); + sprintf(tempstr, "extra AC vs undead"); break; case IPL_MANATOLIFE: - strcpy(tempstr, "50%% Mana moved to Health"); + sprintf(tempstr, "50%% Mana moved to Health"); break; case IPL_LIFETOMANA: - strcpy(tempstr, "40%% Health moved to Mana"); + sprintf(tempstr, "40%% Health moved to Mana"); break; #endif default: From f7a8d515feab4ba5c3c0b7b7ac52111775037857 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 26 Dec 2020 00:17:34 +0100 Subject: [PATCH 10/20] [hellfire] CalcPlrItemVals --- Source/items.cpp | 49 +++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 67870c2fd..14d05b69a 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -724,9 +724,9 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) ItemStruct *itm = &plr[p].InvBody[i]; if (itm->_itype != ITYPE_NONE && itm->_iStatFlag) { - tac += itm->_iAC; mind += itm->_iMinDam; maxd += itm->_iMaxDam; + tac += itm->_iAC; if (itm->_iSpell != SPL_NULL) { spl |= SPELLBIT(itm->_iSpell); @@ -736,14 +736,16 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) bdam += itm->_iPLDam; btohit += itm->_iPLToHit; if (itm->_iPLAC) { - int tmpac = itm->_iPLAC * itm->_iAC / 100; + int tmpac = itm->_iAC; + tmpac *= itm->_iPLAC; + tmpac /= 100; if (tmpac == 0) tmpac = 1; bac += tmpac; } iflgs |= itm->_iFlags; #ifdef HELLFIRE - pDamAcFlags |= plr[p].pDamAcFlags; + pDamAcFlags |= itm->_iDamAcFlags; #endif sadd += itm->_iPLStr; madd += itm->_iPLMag; @@ -781,10 +783,8 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) #ifdef HELLFIRE if (plr[p]._pClass == PC_MONK) { - if (plr[p]._pLevel >> 1 >= 1) - mind = plr[p]._pLevel >> 1; - if (maxd <= plr[p]._pLevel) - maxd = plr[p]._pLevel; + mind = max(mind, plr[p]._pLevel >> 1); + maxd = max(maxd, plr[p]._pLevel); } #endif } @@ -825,11 +825,10 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) if (plr[p]._pLightRad != lrad && p == myplr) { ChangeLightRadius(plr[p]._plid, lrad); - pvid = plr[p]._pvid; - if (lrad >= 10) { - ChangeVisionRadius(pvid, lrad); + if (lrad < 10) { + ChangeVisionRadius(plr[p]._pvid, 10); } else { - ChangeVisionRadius(pvid, 10); + ChangeVisionRadius(plr[p]._pvid, lrad); } plr[p]._pLightRad = lrad; @@ -908,7 +907,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) // check if the current RSplType is a valid/allowed spell if (plr[p]._pRSplType == RSPLTYPE_CHARGES - && !(spl & SPELLBIT(plr[p]._pRSpell))) { + && !(plr[p]._pISpells & SPELLBIT(plr[p]._pRSpell))) { plr[p]._pRSpell = SPL_INVALID; plr[p]._pRSplType = RSPLTYPE_INVALID; force_redraw = 255; @@ -940,24 +939,36 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) if (mr > MAXRESIST) mr = MAXRESIST; +#ifdef HELLFIRE + else if (mr < 0) + mr = 0; +#endif plr[p]._pMagResist = mr; if (fr > MAXRESIST) fr = MAXRESIST; +#ifdef HELLFIRE + else if (fr < 0) + fr = 0; +#endif plr[p]._pFireResist = fr; if (lr > MAXRESIST) lr = MAXRESIST; +#ifdef HELLFIRE + else if (lr < 0) + lr = 0; +#endif plr[p]._pLghtResist = lr; if (plr[p]._pClass == PC_WARRIOR) { - vadd *= 2; + vadd <<= 1; } #ifdef HELLFIRE - if (plr[p]._pClass == PC_BARBARIAN) { - vadd *= 3; - } - if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) { + else if (plr[p]._pClass == PC_BARBARIAN) { + vadd += vadd; + vadd += (vadd >> 2); + } else if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK || plr[p]._pClass == PC_BARD) { #else if (plr[p]._pClass == PC_ROGUE) { #endif @@ -966,7 +977,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) ihp += (vadd << 6); if (plr[p]._pClass == PC_SORCERER) { - madd *= 2; + madd <<= 1; } #ifdef HELLFIRE if (plr[p]._pClass == PC_ROGUE || plr[p]._pClass == PC_MONK) { @@ -977,7 +988,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) } #ifdef HELLFIRE else if (plr[p]._pClass == PC_BARD) { - madd += madd >> 2 + madd >> 1; + madd += (madd >> 2) + (madd >> 1); } #endif imana += (madd << 6); From 591c51778d8292929b89405fa4ef538ec5cbb594 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 06:45:24 +0100 Subject: [PATCH 11/20] Adjust are-we-d1-yet to CircleCI envs --- .travis/are-we-d1-yet.sh | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.travis/are-we-d1-yet.sh b/.travis/are-we-d1-yet.sh index e2b38edbb..922fefdd1 100755 --- a/.travis/are-we-d1-yet.sh +++ b/.travis/are-we-d1-yet.sh @@ -2,11 +2,8 @@ # based on https://github.com/k3rn31p4nic/travis-ci-discord-webhook -# Only run for commits/builds on master|hellfire, not for PRs for now -if [[ "$TRAVIS_BRANCH" != "master" && "$TRAVIS_BRANCH" != "hellfire" ]]; then - exit -fi -if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then +# Only run for commits/builds on master, not for PRs for now +if [[ "$CIRCLE_BRANCH" != "master" ]]; then exit fi @@ -17,10 +14,10 @@ fi echo -e "[Webhook]: Sending webhook to Discord...\\n"; -AUTHOR_NAME="$(git log -1 "$TRAVIS_COMMIT" --pretty="%aN")" -COMMITTER_NAME="$(git log -1 "$TRAVIS_COMMIT" --pretty="%cN")" -COMMIT_SUBJECT="$(git log -1 "$TRAVIS_COMMIT" --pretty="%s")" -COMMIT_MESSAGE="$(git log -1 "$TRAVIS_COMMIT" --pretty="%b")" +AUTHOR_NAME="$(git log -1 "$CIRCLE_SHA1" --pretty="%aN")" +COMMITTER_NAME="$(git log -1 "$CIRCLE_SHA1" --pretty="%cN")" +COMMIT_SUBJECT="$(git log -1 "$CIRCLE_SHA1" --pretty="%s")" +COMMIT_MESSAGE="$(git log -1 "$CIRCLE_SHA1" --pretty="%b")" if [ "$AUTHOR_NAME" == "$COMMITTER_NAME" ]; then CREDITS="$AUTHOR_NAME authored & committed" @@ -30,16 +27,15 @@ fi TIMESTAMP=$(date --utc +%FT%TZ) WEBHOOK_DATA='{ - "avatar_url": "https://travis-ci.com/images/logos/TravisCI-Mascot-1.png", + "avatar_url": "https://www.saaves.com/storage/brochure/logo-circleci-icon1583764538.png", "embeds": [ { "author": { - "name": "'"$3"' #'"$TRAVIS_JOB_NUMBER"' (Build #'"$TRAVIS_BUILD_NUMBER"')", - "url": "https://travis-ci.org/'"$TRAVIS_REPO_SLUG"'/builds/'"$TRAVIS_BUILD_ID"'", - "icon_url": "https://travis-ci.com/images/logos/TravisCI-Mascot-1.png" + "name": "'"$3"' #'"$CIRCLE_WORKFLOW_JOB_ID"' (Build #'"$CIRCLE_BUILD_NUM"')", + "url": "'"$CIRCLE_BUILD_URL"'", + "icon_url": "https://www.saaves.com/storage/brochure/logo-circleci-icon1583764538.png" }, - "title": "['"\`${TRAVIS_COMMIT:0:7}\`"'] '"$COMMIT_SUBJECT"'", - "url": "'"https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT"'", - "description": "'"$CREDITS"'", + "title": "['"\`${CIRCLE_SHA1:0:7}\`"'] '"$COMMIT_SUBJECT"'", + "url": "'"https://github.com/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_USERNAME/commit/$CIRCLE_SHA1"'", "fields": [ { "name": "Binary accuracy", From e7350615c4ff1b00d689f93218bd80cefeaaa06d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 06:51:56 +0100 Subject: [PATCH 12/20] Add CircleCI build status badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7895e63ad..975385372 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://circleci.com/gh/diasurgical/devilution.svg?style=svg)](https://circleci.com/gh/diasurgical/devilution) [![Build Status](https://www.travis-ci.com/diasurgical/devilution.svg?branch=master)](https://www.travis-ci.com/diasurgical/devilution) [![Build status](https://ci.appveyor.com/api/projects/status/ssk0xjhoka1uu940?svg=true)](https://ci.appveyor.com/project/galaxyhaxz/devilution) [![Build status](https://img.shields.io/github/downloads/diasurgical/devilution/total.svg)](https://github.com/diasurgical/devilution/releases) From 31f7861a6ce60ccff5a26fd9c96f152acfc4b229 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 07:53:17 +0100 Subject: [PATCH 13/20] Update AppVeyor badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 975385372..a89ad0de6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Build Status](https://circleci.com/gh/diasurgical/devilution.svg?style=svg)](https://circleci.com/gh/diasurgical/devilution) [![Build Status](https://www.travis-ci.com/diasurgical/devilution.svg?branch=master)](https://www.travis-ci.com/diasurgical/devilution) -[![Build status](https://ci.appveyor.com/api/projects/status/ssk0xjhoka1uu940?svg=true)](https://ci.appveyor.com/project/galaxyhaxz/devilution) -[![Build status](https://img.shields.io/github/downloads/diasurgical/devilution/total.svg)](https://github.com/diasurgical/devilution/releases) +[![Build status](https://ci.appveyor.com/api/projects/status/ce9wnf46gqqk6prp?svg=true)](https://ci.appveyor.com/project/AJenbo/devilution) +[![Downloads](https://img.shields.io/github/downloads/diasurgical/devilution/total.svg)](https://github.com/diasurgical/devilution/releases) [![github stars](https://img.shields.io/github/stars/diasurgical/devilution.svg)](https://github.com/diasurgical/devilution/stargazers) ![Discord Channel](https://avatars3.githubusercontent.com/u/1965106?s=16&v=4) [Discord Chat Channel](https://discord.gg/YQKCAYQ) From 557af483638382d38e702b7ebc1dfb527bac244a Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 09:15:01 +0100 Subject: [PATCH 14/20] [hellfire] SpawnBoy --- Source/items.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++++- defs.h | 2 + 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/Source/items.cpp b/Source/items.cpp index 14d05b69a..ef018bbda 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -5344,6 +5344,31 @@ void SpawnBoy(int lvl) { int itype; +#ifdef HELLFIRE + int ivalue; + int count = 0; + + int strength = get_max_strength(plr[myplr]._pClass); + int dexterity = get_max_dexterity(plr[myplr]._pClass); + int magic = get_max_magic(plr[myplr]._pClass); + int pc = plr[myplr]._pClass; + + if (strength < plr[myplr]._pStrength) { + strength = plr[myplr]._pStrength; + } + strength *= 1.2; + + if (dexterity < plr[myplr]._pDexterity) { + dexterity = plr[myplr]._pDexterity; + } + dexterity *= 1.2; + + if (magic < plr[myplr]._pMagic) { + magic = plr[myplr]._pMagic; + } + magic *= 1.2; +#endif + if (boylevel < (lvl >> 1) || boyitem._itype == ITYPE_NONE) { do { item[0]._iSeed = GetRndSeed(); @@ -5352,10 +5377,87 @@ void SpawnBoy(int lvl) GetItemAttrs(0, itype, lvl); #ifdef HELLFIRE GetItemBonus(0, itype, lvl, 2 * lvl, TRUE, TRUE); + + ivalue = 0; + + int itemType = item[0]._itype; + + switch (itemType) { + case ITYPE_LARMOR: + case ITYPE_MARMOR: + case ITYPE_HARMOR: + ivalue = get_armor_max_value(myplr); + break; + case ITYPE_SHIELD: + ivalue = get_shield_max_value(myplr); + break; + case ITYPE_AXE: + ivalue = get_axe_max_value(myplr); + break; + case ITYPE_BOW: + ivalue = get_bow_max_value(myplr); + break; + case ITYPE_MACE: + ivalue = get_mace_max_value(myplr); + break; + case ITYPE_SWORD: + ivalue = get_sword_max_value(myplr); + break; + case ITYPE_HELM: + ivalue = get_helm_max_value(myplr); + break; + case ITYPE_STAFF: + ivalue = get_staff_max_value(myplr); + break; + case ITYPE_RING: + ivalue = get_ring_max_value(myplr); + break; + case ITYPE_AMULET: + ivalue = get_amulet_max_value(myplr); + break; + } + ivalue *= 0.8; + + count++; + + if (count < 200) { + switch (pc) { + case PC_WARRIOR: + if (itemType == ITYPE_BOW || itemType == ITYPE_STAFF) + ivalue = INT_MAX; + break; + case PC_ROGUE: + if (itemType == ITYPE_SWORD || itemType == ITYPE_STAFF || itemType == ITYPE_AXE || itemType == ITYPE_MACE || itemType == ITYPE_SHIELD) + ivalue = INT_MAX; + break; + case PC_SORCERER: + if (itemType == ITYPE_STAFF || itemType == ITYPE_AXE || itemType == ITYPE_BOW || itemType == ITYPE_MACE) + ivalue = INT_MAX; + break; + case PC_MONK: + if (itemType == ITYPE_BOW || itemType == ITYPE_MARMOR || itemType == ITYPE_SHIELD || itemType == ITYPE_MACE) + ivalue = INT_MAX; + break; + case PC_BARD: + if (itemType == ITYPE_AXE || itemType == ITYPE_MACE || itemType == ITYPE_STAFF) + ivalue = INT_MAX; + break; + case PC_BARBARIAN: + if (itemType == ITYPE_BOW || itemType == ITYPE_STAFF) + ivalue = INT_MAX; + break; + } + } + } while ((item[0]._iIvalue > BOY_MAX_VALUE + || item[0]._iMinStr > strength + || item[0]._iMinMag > magic + || item[0]._iMinDex > dexterity + || item[0]._iIvalue < ivalue) + && count < 250); #else GetItemBonus(0, itype, lvl, 2 * lvl, TRUE); + } while (item[0]._iIvalue > BOY_MAX_VALUE); #endif - } while (item[0]._iIvalue > 90000); boyitem = item[0]; boyitem._iCreateInfo = lvl | CF_BOY; boyitem._iIdentified = TRUE; diff --git a/defs.h b/defs.h index f1a9ef24c..59cd1f482 100644 --- a/defs.h +++ b/defs.h @@ -100,6 +100,7 @@ // todo: enums #ifdef HELLFIRE #define NUMLEVELS 25 +#define BOY_MAX_VALUE 200000 #define WITCH_ITEMS 25 #define SMITH_ITEMS 25 #define SMITH_PREMIUM_ITEMS 15 @@ -108,6 +109,7 @@ #define STORE_LINES 104 #else #define NUMLEVELS 17 +#define BOY_MAX_VALUE 90000 #define WITCH_ITEMS 20 #define SMITH_ITEMS 20 #define SMITH_PREMIUM_ITEMS 6 From 448281a916f3b89bcd327758a3c101108053e679 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 08:44:49 +0100 Subject: [PATCH 15/20] [hellfire] SpawnWitch --- Source/items.cpp | 36 ++++++++++++++++++++++++++++++++---- defs.h | 2 ++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index ef018bbda..e8878ee69 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -5272,9 +5272,15 @@ void WitchBookLevel(int ii) void SpawnWitch(int lvl) { - int i, iCnt; + int i, j, iCnt; int idata, maxlvl; + j = 3; +#ifdef HELLFIRE + iCnt = random_(51, 15) + 10; + int books = random_(3, 4); +#endif + GetItemAttrs(0, IDI_MANA, 1); witchitem[0] = item[0]; witchitem[0]._iCreateInfo = lvl; @@ -5287,9 +5293,31 @@ void SpawnWitch(int lvl) witchitem[2] = item[0]; witchitem[2]._iCreateInfo = lvl; witchitem[2]._iStatFlag = TRUE; + +#ifdef HELLFIRE + int bCnt; + for (i = 114, bCnt = 0; i <= 117 && bCnt < books; ++i) { + if (WitchItemOk(i) + && lvl >= AllItemsList[i].iMinMLvl) { + item[0]._iSeed = GetRndSeed(); + SetRndSeed(item[0]._iSeed); + volatile int junk = random_(0, 1); + + GetItemAttrs(0, i, lvl); + witchitem[j] = item[0]; + witchitem[j]._iCreateInfo = lvl | CF_WITCH; + witchitem[j]._iIdentified = TRUE; + WitchBookLevel(j); + witchitem[j]._iStatFlag = StoreStatOk(&witchitem[j]); + j++; + bCnt++; + } + } +#else iCnt = random_(51, 8) + 10; +#endif - for (i = 3; i < iCnt; i++) { + for (i = j; i < iCnt; i++) { do { item[0]._iSeed = GetRndSeed(); SetRndSeed(item[0]._iSeed); @@ -5306,7 +5334,7 @@ void SpawnWitch(int lvl) #else GetItemBonus(0, idata, maxlvl >> 1, maxlvl, TRUE); #endif - } while (item[0]._iIvalue > 140000); + } while (item[0]._iIvalue > WITCH_MAX_VALUE); witchitem[i] = item[0]; witchitem[i]._iCreateInfo = lvl | CF_WITCH; witchitem[i]._iIdentified = TRUE; @@ -5314,7 +5342,7 @@ void SpawnWitch(int lvl) witchitem[i]._iStatFlag = StoreStatOk(&witchitem[i]); } - for (i = iCnt; i < 20; i++) + for (i = iCnt; i < WITCH_ITEMS; i++) witchitem[i]._itype = ITYPE_NONE; SortWitch(); diff --git a/defs.h b/defs.h index 59cd1f482..02038ed3a 100644 --- a/defs.h +++ b/defs.h @@ -102,6 +102,7 @@ #define NUMLEVELS 25 #define BOY_MAX_VALUE 200000 #define WITCH_ITEMS 25 +#define WITCH_MAX_VALUE 200000 #define SMITH_ITEMS 25 #define SMITH_PREMIUM_ITEMS 15 #define SMITH_MAX_VALUE 200000 @@ -111,6 +112,7 @@ #define NUMLEVELS 17 #define BOY_MAX_VALUE 90000 #define WITCH_ITEMS 20 +#define WITCH_MAX_VALUE 140000 #define SMITH_ITEMS 20 #define SMITH_PREMIUM_ITEMS 6 #define SMITH_MAX_VALUE 140000 From 41ef7532d4310082ff22762d40035b12cf37768e Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 18:41:58 +0100 Subject: [PATCH 16/20] Clear build files before building the debug version --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 311171307..6a7102066 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,8 +63,9 @@ jobs: - checkout - run: apt-get update -y - run: apt-get install -y mingw-w64 make - - run: make - - run: make debug + - run: make -j2 + - run: make clean + - run: make debug -j2 workflows: version: 2 From 7fea616a576e1e159070305d797f95fae9733f02 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 18:48:22 +0100 Subject: [PATCH 17/20] Correct Discord webhook --- {.travis => .circleci}/are-we-d1-yet.sh | 5 +++-- .circleci/config.yml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) rename {.travis => .circleci}/are-we-d1-yet.sh (88%) diff --git a/.travis/are-we-d1-yet.sh b/.circleci/are-we-d1-yet.sh similarity index 88% rename from .travis/are-we-d1-yet.sh rename to .circleci/are-we-d1-yet.sh index 922fefdd1..0e2cfcbd7 100755 --- a/.travis/are-we-d1-yet.sh +++ b/.circleci/are-we-d1-yet.sh @@ -30,12 +30,13 @@ WEBHOOK_DATA='{ "avatar_url": "https://www.saaves.com/storage/brochure/logo-circleci-icon1583764538.png", "embeds": [ { "author": { - "name": "'"$3"' #'"$CIRCLE_WORKFLOW_JOB_ID"' (Build #'"$CIRCLE_BUILD_NUM"')", + "name": "'"$3"' (Build #'"$CIRCLE_BUILD_NUM"')", "url": "'"$CIRCLE_BUILD_URL"'", "icon_url": "https://www.saaves.com/storage/brochure/logo-circleci-icon1583764538.png" }, "title": "['"\`${CIRCLE_SHA1:0:7}\`"'] '"$COMMIT_SUBJECT"'", - "url": "'"https://github.com/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_USERNAME/commit/$CIRCLE_SHA1"'", + "url": "'"https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"'", + "description": "'"$CREDITS"'", "fields": [ { "name": "Binary accuracy", diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a7102066..b98cfd2d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja:stable ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" + .circleci/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Diablo 1.09b" spawn_109b_diff: machine: true steps: @@ -37,7 +37,7 @@ jobs: docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb -e SPAWN=1 diasurgical/riivaaja:stable ./devilution-comparer generate-full Diablo.exe --no-mem-disp --truncate-to-original docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../spawn-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" + .circleci/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Spawn 1.09b" hellfire_101_diff: machine: true steps: @@ -55,7 +55,7 @@ jobs: dd if=Diablo.exe >> hellfire.exe ./devilution-comparer generate-full hellfire.exe --no-mem-disp --truncate-to-original docker run -v $(pwd):/root/devilution diasurgical/riivaaja:stable ../hellfire-status.sh - .travis/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" + .circleci/are-we-d1-yet.sh "$(< accuracy.txt)" $DISCORD_WEBHOOK "Hellfire 1.01" linux: docker: - image: debian:stretch-backports From b880bf0160bbb4a2c6b199ec32591d85ff6cfbb2 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 20:04:13 +0100 Subject: [PATCH 18/20] [hellfire] WitchRechargeOk --- Source/stores.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/stores.cpp b/Source/stores.cpp index 7e803f32e..65eea98c3 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1063,6 +1063,12 @@ BOOL WitchRechargeOk(int i) && plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges) { rv = TRUE; } +#ifdef HELLFIRE + if ((plr[myplr].InvList[i]._iMiscId == IMISC_UNIQUE || plr[myplr].InvList[i]._iMiscId == IMISC_STAFF) + && plr[myplr].InvList[i]._iCharges < plr[myplr].InvList[i]._iMaxCharges) { + rv = TRUE; + } +#endif return rv; } From 6468b1e6e8c4a9cb9efa92b9eede1354e7d00396 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 18:22:45 +0100 Subject: [PATCH 19/20] Clean up PrintSString --- Source/stores.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/stores.cpp b/Source/stores.cpp index 65eea98c3..5e7b0b6a0 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -156,19 +156,19 @@ void DrawSTextBack() void PrintSString(int x, int y, BOOL cjustflag, const char *str, char col, int val) { - int xx, yy; int len, width, off, i, k, s; + int xx, yy; BYTE c; char valstr[32]; s = SStringY[y] + stext[y]._syoff; - if (stextsize) + if (stextsize != 0) xx = PANEL_X + 32; else xx = PANEL_X + 352; off = xx + x + PitchTbl[s + 44 + SCREEN_Y]; len = strlen(str); - if (stextsize) + if (stextsize != 0) yy = 577; else yy = 257; @@ -187,7 +187,7 @@ void PrintSString(int x, int y, BOOL cjustflag, const char *str, char col, int v for (i = 0; i < len; i++) { c = fontframe[gbFontTransTbl[(BYTE)str[i]]]; k += fontkern[c] + 1; - if (c && k <= yy) { + if (c != 0 && k <= yy) { PrintChar(off, c, col); } off += fontkern[c] + 1; @@ -195,10 +195,11 @@ void PrintSString(int x, int y, BOOL cjustflag, const char *str, char col, int v if (!cjustflag && val >= 0) { sprintf(valstr, "%i", val); off = PitchTbl[s + 44 + SCREEN_Y] + PANEL_X + 592 - x; - for (i = strlen(valstr) - 1; i >= 0; i--) { + len = strlen(valstr); + for (i = len - 1; i >= 0; i--) { c = fontframe[gbFontTransTbl[(BYTE)valstr[i]]]; off -= fontkern[c] + 1; - if (c) { + if (c != 0) { PrintChar(off, c, col); } } From cc420a43a622d18462cccd5e3b3f1686e22de495 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Dec 2020 20:00:08 +0100 Subject: [PATCH 20/20] [hellfire] WitchSellOk --- Source/stores.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/stores.cpp b/Source/stores.cpp index 5e7b0b6a0..23ffb0bd8 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -972,7 +972,15 @@ BOOL WitchSellOk(int i) if (pI->_itype == ITYPE_MISC) rv = TRUE; +#ifdef HELLFIRE + if (pI->_iMiscId > 29 && pI->_iMiscId < 41) + rv = FALSE; + if (pI->_iClass == ICLASS_QUEST) + rv = FALSE; + if (pI->_itype == ITYPE_STAFF && pI->_iSpell != SPL_NULL) +#else if (pI->_itype == ITYPE_STAFF) +#endif rv = TRUE; if (pI->IDidx >= IDI_FIRSTQUEST && pI->IDidx <= IDI_LASTQUEST) rv = FALSE;