Space Colonizers:Global File

From Grifkuba General Wiki
Jump to navigation Jump to search
/**************************************
 *                                    *
 *          Global                    *
 *                                    *
 *    contains global functions       *
 *                                    *
 **************************************/


/*
 * Name: heal
 * Purpose: increase current HP so 
 * Input:
	** int - amount of change 
	** int - the id of the fighter being healed
 * Output:
	** none
 * Sample:
	** 
 * Other Details: 
	** 
 */
 
public function heal(int delta_amount, character* target)
{
	int first = target.current_amount;
	int last;
	if(target.max_amount > (target.current_amount + delta_amount))
	{
		target.current_amount = target.max_amount;
	}
	else
	{
		target.current_amount += target.delta_amount;
	}
	last = target.current_amount;
	animate(first, last, hp);
	return;
}


/*
 * Name: message
 * Purpose: Deliver message to the player
 * Input:
	** int - id of the message
 * Output:
	** none
 * Sample:
	** 
 * Other Details: 
	** 
 */
 
public function message(int id)
{
	switch(id)
	{
		case:
			/* no miss */
			break;
		case:
			/* miss */
			break;
		case:
			/* block */
			break;
		case:
			/* no_block */
			break;
		default:
			break;
	}
}

/*
 * Name: damage
 * Purpose: Decides how much damage to do
 * Input:
	** character - id of the attacker
	** character - id of the defender
	** int - id of the skill
 * Output:
	** float - none
  * Sample:
	** damage(character* id, character* target, extra_details.skill_id);
 * Other Details: 
	** 
 */

public function damage(character attacker, character defender, int skill)
{
	float ba = base_attck(skill);
	float st = attacker.strength
	float da = (ba + st)/2.0; 
	target.current_amount -= da;
	return;
	
}