Skip to content

Commit

Permalink
Update to Dark World
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed May 14, 2015
1 parent 98547f6 commit bdce391
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions DevMod/DevMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace DevMod
[Patch]
public class MyPlayer : Player
{
public MyPlayer(int playerIndex, Vector2 position, Allegiance allegiance, Allegiance teamColor, PlayerInventory inventory, Player.HatState hatState, bool frozen = true)
: base(playerIndex, position, allegiance, teamColor, inventory, hatState, frozen)
public MyPlayer(int playerIndex, Vector2 position, Allegiance allegiance, Allegiance teamColor, PlayerInventory inventory, Player.HatStates hatState, bool frozen, bool flash, bool indicator)
: base(playerIndex, position, allegiance, teamColor, inventory, hatState, frozen, flash, indicator)
{
}

Expand Down
13 changes: 7 additions & 6 deletions Mod/GameModes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public class MyVersusRoundResults : VersusRoundResults
{
private Modes _oldMode;

public MyVersusRoundResults(Session session)
: base(session)
public MyVersusRoundResults(Session session, List<EventLog> events)
: base(session, events)
{
this._oldMode = session.MatchSettings.Mode;
if (this._oldMode == RespawnRoundLogic.Mode || this._oldMode == MobRoundLogic.Mode)
Expand Down Expand Up @@ -189,7 +189,7 @@ public override void OnLevelLoadFinish()
base.Players = base.SpawnPlayersFFA();
}

public override bool CheckForAllButOneDead()
public override bool FFACheckForAllButOneDead()
{
return false;
}
Expand All @@ -211,7 +211,8 @@ protected Player RespawnPlayer(int playerIndex)
List<Vector2> spawnPositions = this.Session.CurrentLevel.GetXMLPositions("PlayerSpawn");

var player = new Player(playerIndex, new Random().Choose(spawnPositions), Allegiance.Neutral, Allegiance.Neutral,
this.Session.GetPlayerInventory(playerIndex), this.Session.GetSpawnHatState(playerIndex), frozen: false);
this.Session.GetPlayerInventory(playerIndex), this.Session.GetSpawnHatState(playerIndex),
frozen: false, flash: false, indicator: true);
this.Session.CurrentLevel.Add(player);
player.Flash(120, null);
Alarm.Set(player, 60, player.RemoveIndicator, Alarm.AlarmMode.Oneshot);
Expand Down Expand Up @@ -310,9 +311,9 @@ public MyPlayerGhost(PlayerCorpse corpse)
this.corpse = corpse;
}

public override void Die(int killerIndex, Arrow arrow, Explosion explosion)
public override void Die(int killerIndex, Arrow arrow, Explosion explosion, ShockCircle circle)
{
base.Die(killerIndex, arrow, explosion);
base.Die(killerIndex, arrow, explosion, circle);
var mobLogic = this.Level.Session.RoundLogic as MobRoundLogic;
if (mobLogic != null) {
mobLogic.OnPlayerDeath(
Expand Down
4 changes: 2 additions & 2 deletions Mod/Variants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public MyMatchVariants()
[Patch]
public class MyPlayer : Player
{
public MyPlayer(int playerIndex, Vector2 position, Allegiance allegiance, Allegiance teamColor, PlayerInventory inventory, Player.HatState hatState, bool frozen = true)
: base(playerIndex, position, allegiance, teamColor, inventory, hatState, frozen)
public MyPlayer(int playerIndex, Vector2 position, Allegiance allegiance, Allegiance teamColor, PlayerInventory inventory, Player.HatStates hatState, bool frozen, bool flash, bool indicator)
: base(playerIndex, position, allegiance, teamColor, inventory, hatState, frozen, flash, indicator)
{
}

Expand Down
9 changes: 5 additions & 4 deletions Patcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,24 @@ public static void PatchResources()
var xml = XElement.Load(Path.Combine("Original", atlasPath + ".xml"));

string[] files = Directory.GetFiles(atlasPath, "*.png", SearchOption.AllDirectories);
int x = 700;
int x = 1720;
int y = 1700;

using (var baseImage = Bitmap.FromFile(Path.Combine("Original", atlasPath + ".png"))) {
using (var g = Graphics.FromImage(baseImage))
foreach (string file in files)
using (var image = Bitmap.FromFile(file)) {
string name = file.Substring(atlasPath.Length + 1).Replace(Path.DirectorySeparatorChar, '/');
name = name.Substring(0, name.Length - ".png".Length);
g.DrawImage(image, x, 1700);
g.DrawImage(image, x, y);
xml.Add(new XElement("SubTexture",
new XAttribute("name", name),
new XAttribute("x", x),
new XAttribute("y", 1700),
new XAttribute("y", y),
new XAttribute("width", image.Width),
new XAttribute("height", image.Height)
));
x += image.Width;
y += image.Height;
}
baseImage.Save(atlasPath + ".png");
}
Expand Down

0 comments on commit bdce391

Please sign in to comment.