<commit_before>from __main__ import game
from toee import *
import race_defs

#########################################
# Ability scores
#########################################
def OnGetAbilityScore(attachee, args, evt_obj):
	statType = args.get_param(0)
	statMod = args.get_param(1)
	if attachee.d20_query(EK_Q_Polymorphed):
		if (statType == stat_strength) or (statType == stat_constitution) or (statType == stat_dexterity):
			return 0
	newValue = statMod + evt_obj.bonus_list.get_sum()
	if (newValue < 3): # ensure minimum stat of 3
		statMod = 3-newValue
	evt_obj.bonus_list.add(statMod, 0, 139)
	return 0

def AddAbilityModifierHooks(raceSpecObj, raceSpecModule):
	statMods = race_defs.GetStatModifiers(raceSpecModule.raceEnum) #raceSpecModule.GetStatModifiers()
	for p in range(0,6):
		if statMods[p] == 0:
			continue
		statType = p
		statMod = statMods[p]
		raceSpecObj.AddHook(ET_OnAbilityScoreLevel, EK_STAT_STRENGTH+p, OnGetAbilityScore, (p,statMods[p]))
		raceSpecObj.AddHook(ET_OnStatBaseGet, EK_STAT_STRENGTH+p, OnGetAbilityScore, (p,statMods[p]))
	return



#########################################
## Saving Throws
#########################################
def OnGetSaveThrow(attachee, args, evt_obj):
	value = args.get_param(0)
	evt_obj.bonus_list.add(value, 0, 139)
	return 0
<commit_msg>Fixed incorrect query value.<commit_after>from __main__ import game
from toee import *
import race_defs

#########################################
# Ability scores
#########################################
def OnGetAbilityScore(attachee, args, evt_obj):
	statType = args.get_param(0)
	statMod = args.get_param(1)
	if attachee.d20_query(Q_Polymorphed):
		if (statType == stat_strength) or (statType == stat_constitution) or (statType == stat_dexterity):
			return 0
	newValue = statMod + evt_obj.bonus_list.get_sum()
	if (newValue < 3): # ensure minimum stat of 3
		statMod = 3-newValue
	evt_obj.bonus_list.add(statMod, 0, 139)
	return 0

def AddAbilityModifierHooks(raceSpecObj, raceSpecModule):
	statMods = race_defs.GetStatModifiers(raceSpecModule.raceEnum) #raceSpecModule.GetStatModifiers()
	for p in range(0,6):
		if statMods[p] == 0:
			continue
		statType = p
		statMod = statMods[p]
		raceSpecObj.AddHook(ET_OnAbilityScoreLevel, EK_STAT_STRENGTH+p, OnGetAbilityScore, (p,statMods[p]))
		raceSpecObj.AddHook(ET_OnStatBaseGet, EK_STAT_STRENGTH+p, OnGetAbilityScore, (p,statMods[p]))
	return



#########################################
## Saving Throws
#########################################
def OnGetSaveThrow(attachee, args, evt_obj):
	value = args.get_param(0)
	evt_obj.bonus_list.add(value, 0, 139)
	return 0

{'fraction_non_alphanumeric': 0.2169452887537994, 'fraction_numerical': 0.016717325227963525, 'mean_word_length': 6.813056379821958, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5701047', 'n_tokens_mistral': 1007, 'n_tokens_neox': 934, 'n_words': 183}