<commit_before>
#include "stdafx.h"
#include "util/fixes.h"
#include "common.h"
#include "obj.h"
#include "turn_based.h"
#include "critter.h"
#include "condition.h"
#include "bonus.h"
#include <pathfinding.h>
#include "ui/ui.h"
#include <combat.h>
#include <action_sequence.h>
#include <tig/tig_font.h>
#include <party.h>
#include <damage.h>
#include "ui/ui_systems.h"
#include "ui/ui_legacysystems.h"
#include "animgoals/anim.h"
#include <gamesystems\objects\objsystem.h>
#include <location.h>
#include "gamesystems/gamesystems.h"

struct TigTextStyle;

// fixes size_colossal (was misspelled as size_clossal)
class SizeColossalFix : public TempleFix {
public:

	void apply() override {
		writeHex(0x10278078, "73 69 7A 65 5F 63 6F 6C 6F 73 73 61 6C");
	}
} sizeColossalFix;

// Makes Kukri Proficiency Martial
class KukriFix : public TempleFix {
public:
	void apply() override {
		writeHex(0x102BFD78 + 30*4, "00 09"); // marks Kukri as Martial in the sense that picking "Martial Weapons Proficiency" will now list Kukri
		// see rest of fix in weapon.cpp IsMartialWeapon
	}
} kukriFix;


objHndl __cdecl ItemWornAtModifiedForTumlbeCheck(objHndl objHnd, uint32_t itemWornSlot)
{ // hook inside 0x1008AA90 ; will also affect dwarf subraces
	if (critterSys.GetRace(objHnd) == race_dwarf)
	{
		return objHndl::null;
	}
	else
	{
		return objects.inventory.ItemWornAt(objHnd, itemWornSlot);
	}
}

// Allows Dwarves to tumble in heavy armor
class DwarfTumbleFix : public TempleFix
{<commit_msg>Fixes #682 Orb of Golden Death infinite Earth Elemental summoning<commit_after>
#include "stdafx.h"
#include "util/fixes.h"
#include "common.h"
#include "obj.h"
#include "turn_based.h"
#include "critter.h"
#include "condition.h"
#include "bonus.h"
#include <pathfinding.h>
#include "ui/ui.h"
#include <combat.h>
#include <action_sequence.h>
#include <tig/tig_font.h>
#include <party.h>
#include <damage.h>
#include "ui/ui_systems.h"
#include "ui/ui_legacysystems.h"
#include "animgoals/anim.h"
#include <gamesystems\objects\objsystem.h>
#include <location.h>
#include "gamesystems/gamesystems.h"

struct TigTextStyle;


class HexFixes : public TempleFix {
public:

	void apply() override {

		// fixes size_colossal (was misspelled as size_clossal)
		writeHex(0x10278078, "73 69 7A 65 5F 63 6F 6C 6F 73 73 61 6C");

		// fixes Orb of Golden Death infinite Earth Elementals
		writeHex(0x101034D9, "C1 E0 10"); // was 08, a wrong shift (looks like a typo error, all the others are shifted by 0x10: radMenuEntry.d20ActionData1 = (invIdxFromCondArg2 << 16) | [spellIdx]
	}
} hexFixes;

// Makes Kukri Proficiency Martial
class KukriFix : public TempleFix {
public:
	void apply() override {
		writeHex(0x102BFD78 + 30*4, "00 09"); // marks Kukri as Martial in the sense that picking "Martial Weapons Proficiency" will now list Kukri
		// see rest of fix in weapon.cpp IsMartialWeapon
	}
} kukriFix;


objHndl __cdecl ItemWornAtModifiedForTumlbeCheck(objHndl objHnd, uint32_t itemWornSlot)
{ // hook inside 0x1008AA90 ; will also affect dwarf subraces
	if (critterSys.GetRace(objHnd) == race_dwarf)
	{
		return objHndl::null;
	}
	else
	{
		return objects.inventory.ItemWornAt(objHnd, itemWornSlot);
	}
}

// Allows Dwarves to tumble in heavy armor
class DwarfTumbleFix : public TempleFix
{
{'fraction_non_alphanumeric': 0.11365719523373052, 'fraction_numerical': 0.03910785212343416, 'mean_word_length': 4.888489208633094, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '501239', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1245, 'n_words': 338}