<commit_before>// --------------------------------------------------------------------------
//
// Base Weapon Definition
//
// --------------------------------------------------------------------------

class EriWeapon : DoomWeapon
{
	int magsize;

	Property MagSize:magsize;

	Default
	{
		Scale 0.8;
	}
	States
	{
	DoReload:
		#### # 1 A_Print("You forgot to add a DoReload state, dummy!");
		Goto ResolveReady;
	AltFire:
	Reload:
		#### # 1 X_Reload();
		Goto ResolveReady;
	ResolveReady:
		#### # 0 ResolveState("Ready"); 
		Stop;
	}

	override void PostBeginPlay()
	{
		self.reloadcounter = self.magsize;
	}
	
	override State GetAtkState(bool hold)
	{
		if(self.magsize > 0 && self.reloadcounter <= 0) {
			state reloadState = X_Reload();
			return reloadState ? reloadState : Super.GetAtkState(hold);
		} else {
			self.reloadcounter--;
		}
		return Super.GetAtkState(hold);
	}

	action state X_Reload()
	{
		int reloadAmount = min(invoker.magsize, invoker.ammo1 ? invoker.ammo1.amount : 99999);
		if(invoker.reloadcounter < reloadAmount) {
			invoker.reloadcounter = reloadAmount;
			return ResolveState("DoReload");
		}
		return null;
	}

	action state X_ReloadIfEmpty()
	{
		if(invoker.reloadcounter <= 0) {
			return X_Reload();<commit_msg>removed altfire-to-reload default<commit_after>// --------------------------------------------------------------------------
//
// Base Weapon Definition
//
// --------------------------------------------------------------------------

class EriWeapon : DoomWeapon
{
	int magsize;

	Property MagSize:magsize;

	Default
	{
		Scale 0.8;
	}
	States
	{
	DoReload:
		#### # 1 A_Print("You forgot to add a DoReload state, dummy!");
		Goto ResolveReady;
	Reload:
		#### # 1 X_Reload();
		Goto ResolveReady;
	ResolveReady:
		#### # 0 ResolveState("Ready"); 
		Stop;
	}

	override void PostBeginPlay()
	{
		self.reloadcounter = self.magsize;
	}
	
	override State GetAtkState(bool hold)
	{
		if(self.magsize > 0 && self.reloadcounter <= 0) {
			state reloadState = X_Reload();
			return reloadState ? reloadState : Super.GetAtkState(hold);
		} else {
			self.reloadcounter--;
		}
		return Super.GetAtkState(hold);
	}

	action state X_Reload()
	{
		int reloadAmount = min(invoker.magsize, invoker.ammo1 ? invoker.ammo1.amount : 99999);
		if(invoker.magsize > 0 && invoker.reloadcounter < reloadAmount) {
			invoker.reloadcounter = reloadAmount;
			return ResolveState("DoReload");
		}
		return null;
	}

	action state X_ReloadIfEmpty()
	{
		if(invoker.reloadcounter <= 0) {
			return X_Reload();
{'fraction_non_alphanumeric': 0.2339250493096647, 'fraction_numerical': 0.01222879684418146, 'mean_word_length': 2.2346938775510203, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, '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': '5209783', 'n_tokens_mistral': 932, 'n_tokens_neox': 825, 'n_words': 172}