Repository navigation
Expand file tree
/
Copy pathC3Player.cs
More file actions
49 lines (45 loc) · 1.75 KB
/
Copy pathC3Player.cs
File metadata and controls
49 lines (45 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using TShockAPI;
namespace C3Mod
{
public class C3Player
{
public int Index;
public int Team = 0;
public bool TerrariaDead { get { return Main.player[Index].dead; } }
public bool Dead = false;
public string GameType = "";
public int TerrariaTeam { get { return Main.player[Index].team; } }
public string PlayerName { get { return Main.player[Index].name; } }
public float tileX { get { return (Main.player[Index].position.X / 16); } }
public float tileY { get { return (Main.player[Index].position.Y / 16); } }
public TSPlayer TSPlayer { get { return (C3Tools.GetTSPlayerByIndex(Index)); } }
public C3Player Challenging;
public int ChallengeArena { get; set; }
public DateTime ChallengeTick = DateTime.UtcNow;
public int ChallengeNotifyCount = 0;
public bool Spectator = false;
public int LivesUsed = 0;
public Vector2[] tempflags = new Vector2[2];
public Vector2[] tempspawns = new Vector2[2];
public int FFAScore = 0;
public DateTime LastSpawn = DateTime.UtcNow;
public bool SpawnProtectionEnabled = false;
public C3Player KillingPlayer = null;
public C3Player(int index)
{
Index = index;
}
public void SendMessage(string message, Color color)
{
NetMessage.SendData((int)PacketTypes.ChatText, Index, -1, message, 255, color.R, color.G, color.B);
}
public void GiveItem(int type, string name, int width, int height, int stack)
{
TShock.Players[Index].GiveItem(type, name, width, height, stack);
}
}
}