Back to home

Rock Paper Scissors Deathmatch

CW19H
click to copy
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.

Category:
Custom game mode

Author:
Gecktendo

Rating:
1

Version:
1.0.0

Posted:
17 days ago

Tags:
rock paper scissors deathmatch ffa

Share this workshop!

Options

Rock Paper Scissors Deathmatch - V.1.0.0 - Coded by Gecktendo#1446 - Rock < Paper < Scissors. We all know the game, now play it in Deathmatch. Press Interact to switch between materials.

variables
{
	player:
		0: Type
}

rule("Rock Paper Scissors Deathmatch - V.1.0.0 - Coded by Gecktendo#1446")
{
	event
	{
		Ongoing - Global;
	}
}

disabled rule("Rules")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Setup HUD")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("Press Interact to Switch Type", Null, Null, Null), Top, 1,
			White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Type), ==, 0)),
			Custom String("You Are: Rock", Null, Null, Null), Null, Null, Top, 2, White, White, White, Visible To and String,
			Default Visibility);
		Create HUD Text(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Type), ==, 1)),
			Custom String("You Are: Paper", Null, Null, Null), Null, Null, Top, 2, White, White, White, Visible To and String,
			Default Visibility);
		Create HUD Text(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Type), ==, 2)),
			Custom String("You Are: Scissors", Null, Null, Null), Null, Null, Top, 2, White, White, White, Visible To and String,
			Default Visibility);
	}
}

rule("Setup Player")
{
	event
	{
		Player Joined Match;
		All;
		All;
	}

	actions
	{
		Set Player Variable(Event Player, Type, Random Integer(0, 2));
		Set Status(Event Player, Null, Unkillable, 9999);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 0)), Compare(Player Variable(
			Current Array Element, Type), ==, 0))), Custom String("Rock", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 0)), Compare(Player Variable(
			Current Array Element, Type), ==, 1))), Custom String("Rock", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 0)), Compare(Player Variable(
			Current Array Element, Type), ==, 2))), Custom String("Rock", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 1)), Compare(Player Variable(
			Current Array Element, Type), ==, 0))), Custom String("Paper", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 1)), Compare(Player Variable(
			Current Array Element, Type), ==, 1))), Custom String("Paper", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 1)), Compare(Player Variable(
			Current Array Element, Type), ==, 2))), Custom String("Paper", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 2)), Compare(Player Variable(
			Current Array Element, Type), ==, 0))), Custom String("Scissors", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 2)), Compare(Player Variable(
			Current Array Element, Type), ==, 1))), Custom String("Scissors", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Create In-World Text(Filtered Array(All Players(All Teams), And(And(And(Compare(Current Array Element, !=, Event Player), Compare(
			Is Alive(Event Player), ==, True)), Compare(Player Variable(Event Player, Type), ==, 2)), Compare(Player Variable(
			Current Array Element, Type), ==, 2))), Custom String("Scissors", Null, Null, Null), Add(Eye Position(Event Player), Vector(0,
			0.500, 0)), 1, Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
	}
}

rule("Interact: Change Type")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
	}

	actions
	{
		Skip If(Or(Or(Or(Or(Has Status(Event Player, Hacked), Has Status(Event Player, Knocked Down)), Has Status(Event Player, Asleep)),
			Has Status(Event Player, Frozen)), Has Status(Event Player, Stunned)), 1);
		Set Player Variable(Event Player, Type, Modulo(Add(Player Variable(Event Player, Type), 1), 3));
	}
}

rule("Player Damage Calculation")
{
	event
	{
		Player Dealt Damage;
		All;
		All;
	}

	actions
	{
		Skip If(Compare(Player Variable(Attacker, Type), !=, Player Variable(Victim, Type)), 1);
		Heal(Victim, Null, Event Damage);
		Skip If(Compare(Player Variable(Attacker, Type), !=, Modulo(Add(Subtract(Player Variable(Victim, Type), 1), 3), 3)), 1);
		Heal(Victim, Null, Multiply(Event Damage, 2));
		Skip If(Compare(Player Variable(Attacker, Type), !=, Modulo(Add(Player Variable(Victim, Type), 1), 3)), 5);
		Skip If(Compare(Health(Victim), >, Event Damage), 4);
		Clear Status(Victim, Unkillable);
		Wait(0.050, Ignore Condition);
		Kill(Victim, Attacker);
		Set Status(Victim, Null, Unkillable, 9999);
	}
}