Skip to content

Commit

Permalink
Updated version and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDeltin committed Jul 4, 2019
1 parent 1d19b55 commit 3a0e4b2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Deltinteger/Deltinteger/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Deltin.Deltinteger
{
public class Program
{
public const string VERSION = "v0.3.8";
public const string VERSION = "v0.3.9";

static Log Log = new Log(":");
static Log ParseLog = new Log("Parse");
Expand Down
2 changes: 1 addition & 1 deletion Examples/Death Spheres.del
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (IsAlive())
if (DistanceBetween(EventPlayer(), loc) < radius)
{
deathCount += 1;
SmallMessage(EventPlayer(), <"Danger! ... dead, try again and survive! sudden death: <0>", deathCount>);
SmallMessage(EventPlayer(), <"Danger! ... dead, try_again and survive! sudden_death: <0>", deathCount>);
Kill();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Murder Mystery.del
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Event.OngoingPlayer
if (isInitialized)
if (role == Observer)
{
CreateHudText(EventPlayer(), <"Ability -> Build in view, Crouch and ability -> go in view">,
CreateHudText(EventPlayer(), <"Ability -> Build in_view, Crouch and ability -> go in_view">,
null, null, Location.Top, 0, Color.Green);
roleHud = LastTextID();
}
Expand Down
35 changes: 0 additions & 35 deletions Examples/hitscan_spheres.del

This file was deleted.

22 changes: 8 additions & 14 deletions Examples/methods.del
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if (IsButtonHeld(EventPlayer(), Button.Interact))
// Iterate through all players to check if they are an AI.
foreach (define player in AllPlayers())
{
define isAI = IsAI(AllPlayers()[player]);
define isAI = IsAI(player);

// Send the message.
SmallMessage(EventPlayer(), <"<0>: <1>", AllPlayers()[player], isAI>);
SmallMessage(EventPlayer(), <"<0>: <1>", player, isAI>);

Wait(2);
}
Expand All @@ -20,27 +20,21 @@ if (IsButtonHeld(EventPlayer(), Button.Interact))
method IsAI(player)
{
define currentHero = HeroOf(player);
define heroSwap = HeroVar(Hero.Ana);
define isAI;
define heroSwap = Hero.Ana;
/*
Swap a player to Ana (Bastion if they are Ana), check if they are the new hero, then swap them back.
Possible improvements: Swap to a hero that isnt an option for AI.
*/

if (currentHero == HeroVar(Hero.Ana))
if (currentHero == Hero.Ana)
{
heroSwap = HeroVar(Hero.Bastion);
heroSwap = Hero.Bastion;
}

ForcePlayerHero(player, heroSwap);
if (HeroOf(player) == currentHero)
{
isAI = true;
}
else
{
isAI = false;
}

define isAI = HeroOf(player) == currentHero;

ForcePlayerHero(player, currentHero);
StopForcingHero(player);

Expand Down

0 comments on commit 3a0e4b2

Please sign in to comment.