[Code] Repair Kit

Post Reply
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Code] Repair Kit

Post by perrinoia »

Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Code] Repair Kit

Post by perrinoia »

I agree.

Crow, quit being a douche and FIX IT!!!

Image
Image
bawb
Posts: 39
Joined: Thu Feb 26, 2015 12:21 pm

Re: [Code] Repair Kit

Post by bawb »

perrinoia wrote:Crow, quit being a douche and FIX IT!!!
:hbeat: :hbeat: :hbeat: :hbeat: :hbeat: :hbeat: :hbeat:
justR
Posts: 382
Joined: Wed Jul 17, 2013 4:06 pm

Re: [Code] Repair Kit

Post by justR »

When I spawn rush a good titan player I use my kit at spawn at full health so they can't take it off my corpse, so there's one reason I don't like this idea

However, most anni players are simple-minded turds so this is a moot point
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Code] Repair Kit

Post by perrinoia »

justR wrote:When I spawn rush a good titan player I use my kit at spawn at full health so they can't take it off my corpse, so there's one reason I don't like this idea

However, most anni players are simple-minded turds so this is a moot point
You are a scumbag for not dropping your healthkits while you dump your ammo... :roll:
Image
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: [Code] Repair Kit

Post by S_hift »

no hes just a scumbag for ammo dropping lol
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
AnniDv6
Posts: 1031
Joined: Mon Dec 12, 2011 3:25 pm

Re: [Code] Repair Kit

Post by AnniDv6 »

Looked into using this awhile back. It made it so if you were at full health you were unable to drop a repair kit on damaged stations, deployables etc. There's probably a way to code around that..
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Code] Repair Kit

Post by perrinoia »

Not just full health... Using that code would prevent tossing kits regardless of your damage level.

Holy shit, this topic's got my OCD tingling like a testicle after sitting with legs crossed for too long.

Code: Select all

function RepairKit::onUse(%player,%item) 
{
		
	// handling this in function Armor::onRepairKit(%player)	
//	if(!$build)
//		Player::decItemCount(%player,%item);
	// GameBase::repairDamage(%player,0.2);
	
	%c = Player::getClient(%player);
	 // Alliance armor support
	%armor = Player::getArmor(%player);
	eval(%armor @ "::onRepairKit(" @ %player @ ");");
}
Each armor has it's own repair kit function? But why... Do any of them behave differently?

Code: Select all

function armormAngel::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfAngel::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormDM::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfDM::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormBuilder::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfBuilder::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function lghost::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function fghost::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormLightArmor::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfLightArmor::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormMercenary::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfMercenary::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormNecro::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfNecro::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormSpy::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfSpy::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorTank::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorTitan::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorTroll::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armormWarrior::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}

Code: Select all

function armorfWarrior::onRepairKit(%player)
{
	Armor::onRepairKit(%player);
}
Nope, they all do the same fucking thing... And what is the thing that they all do? Waste a fucking health kit if you have full health and aren't looking at something that is damaged.

Code: Select all

function Armor::onRepairKit(%player)
{
	 // Heal poison with repair kit
	 %client = Player::getClient(%player);
	$poisonTime[%client] = 0;
	GameBase::repairDamage(%player,0.2); // moved here from RepairKit::onUse(%player,%item) -Plasmatic 3.x
	if(GameBase::getLOSInfo(%player,5)) 
	{
		// Ok, it looks like the origional (Annihilation) Health kit code
		// was intended to use a healthKit to partially fix a station
		// It's now working.. Plasmatic 1/31/2005 6:55AM
		
		// I also added in throwing repair damage.. Toss one at some items to repair..
		%object = $los::object;	
		if(GameBase::getDamageLevel(%object))
		{
			%name = GameBase::getDataName(%object);	
			%class = %name.className;
			%data = %name.description;		
			if(%name == PulseSensor || %class == Generator || %class == Station || %class == Turret || %class == MobileStation)
			{
				%team = GameBase::getTeam(%player); //fix enemy team healing -DaJ4ck3L
				%objteam = GameBase::getTeam(%object);
				if(%team == %objteam)
				{
					remoteDropItem(%client,RepairKit);
				}
				if($build)
					Annihilation::incItemCount(%player,RepairKit);	
					//throw removes it.. 	
				
				//handling this in RepairKit::onCollision(%this,%object)
			//	GameBase::repairDamage(%object,0.27);
			//	GameBase::playSound(%object, ForceFieldOpen,0);
			}
		}
	}
	if(!$build)
		Annihilation::decItemCount(%player,RepairKit);

}
My solution? Fuck all that useless ass code and simplify the god damned thing.

Code: Select all

// No more wasted kits.  Checks if LOS Object is friendly and damaged, or if self is damaged before using. -perrinoia
function RepairKit::onUse(%player, %item)
{
	%client = Player::getClient(%player);
	GameBase::getLOSInfo(%player, 5);
	if(GameBase::getDamageLevel($los::object) && GameBase::getTeam(%player) == GameBase::getTeam($los::object))
		remoteDropItem(%client, %item);
	else if(GameBase::getDamageLevel(%player) || $poisonTime[%client])
	{
		$poisonTime[%client] = 0;
		GameBase::repairDamage(%player, 0.2);
		if(!$build)
			Annihilation::decItemCount(%player, %item);
	}
}
It doesn't have to be so complicated, guys.
Image
Post Reply