mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Planes 1.07
This commit is contained in:
@@ -315,11 +315,11 @@ public class Planes : ICommand
|
|||||||
|
|
||||||
var carrierCount = 6;
|
var carrierCount = 6;
|
||||||
var planesBoard = CreatePlanesBoard(gambler);
|
var planesBoard = CreatePlanesBoard(gambler);
|
||||||
var planesBoard2 = CreatePlanesBoard(gambler);
|
List<int[,]> planesBoards = [planesBoard];
|
||||||
List<int[,]> planesBoards = [planesBoard, planesBoard2];
|
|
||||||
var plane = new Plane(gambler);
|
var plane = new Plane(gambler);
|
||||||
var frameLength = 1000.0;
|
var frameLength = 1000.0;
|
||||||
var fullCounter = 0;
|
var fullCounter = 0;
|
||||||
|
var boardCounter = 0;
|
||||||
bool firstBoard = true;
|
bool firstBoard = true;
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
var noseUp = true;
|
var noseUp = true;
|
||||||
@@ -344,6 +344,7 @@ public class Planes : ICommand
|
|||||||
if (fullCounter > 20) firstBoard = false;
|
if (fullCounter > 20) firstBoard = false;
|
||||||
counter = fullCounter % 23-3;
|
counter = fullCounter % 23-3;
|
||||||
if (!firstBoard) counter += 3;
|
if (!firstBoard) counter += 3;
|
||||||
|
if (counter % 20 == 19) boardCounter++;
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(frameLength / 3), ctx);
|
await Task.Delay(TimeSpan.FromMilliseconds(frameLength / 3), ctx);
|
||||||
var neutral = false;
|
var neutral = false;
|
||||||
var frameCounter = 0;
|
var frameCounter = 0;
|
||||||
@@ -366,7 +367,7 @@ public class Planes : ICommand
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (fullCounter == 3) logger.Info($"Generating first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter}");
|
if (fullCounter == 3) logger.Info($"Generating first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter}");
|
||||||
switch (planesBoard[plane.Height, counter])
|
switch (planesBoards[boardCounter % 2][plane.Height, counter])
|
||||||
{
|
{
|
||||||
|
|
||||||
case 0: //do nothing plane hit neutral space
|
case 0: //do nothing plane hit neutral space
|
||||||
@@ -374,13 +375,13 @@ public class Planes : ICommand
|
|||||||
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: neutral");
|
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: neutral");
|
||||||
break;
|
break;
|
||||||
case 1: //hit rocket
|
case 1: //hit rocket
|
||||||
planesBoard[plane.Height, counter] = 0; //plane consumes rocket
|
planesBoards[boardCounter % 2][plane.Height, counter] = 0; //plane consumes rocket
|
||||||
plane.HitRocket();
|
plane.HitRocket();
|
||||||
noseUp = false;
|
noseUp = false;
|
||||||
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: bomb");
|
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: bomb");
|
||||||
break;
|
break;
|
||||||
case 2: //hit multi
|
case 2: //hit multi
|
||||||
planesBoard[plane.Height, counter] = 0; //plane consumes multi
|
planesBoards[boardCounter % 2][plane.Height, counter] = 0; //plane consumes multi
|
||||||
plane.HitMulti();
|
plane.HitMulti();
|
||||||
noseUp = true;
|
noseUp = true;
|
||||||
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: multi");
|
if (fullCounter == 3) logger.Info($"Generated first plane impact outcome. Framecounter: {frameCounter} | FullCounter: {fullCounter} | Counter: {counter} | Outcome: multi");
|
||||||
@@ -424,11 +425,15 @@ public class Planes : ICommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
plane.Gravity();
|
plane.Gravity();
|
||||||
if ((fullCounter-3) % 20 == 15)//removes old planesboard, adds new planeboard when necessary
|
if ((fullCounter-3) % 20 == 10 && !firstBoard)//removes old planesboard, adds new planeboard when necessary
|
||||||
{
|
{
|
||||||
planesBoards.RemoveAt(0);
|
planesBoards.RemoveAt(0);
|
||||||
planesBoards.Add(CreatePlanesBoard(gambler));
|
planesBoards.Add(CreatePlanesBoard(gambler));
|
||||||
}
|
}
|
||||||
|
else if ((fullCounter-3) % 20 == 10 && firstBoard)//removes old planesboard, adds new planeboard when necessary
|
||||||
|
{
|
||||||
|
planesBoards.Add(CreatePlanesBoard(gambler));
|
||||||
|
}
|
||||||
} while (plane.Height < 6);
|
} while (plane.Height < 6);
|
||||||
//now plane is too low so you have either won or lost depending on your position
|
//now plane is too low so you have either won or lost depending on your position
|
||||||
var colors =
|
var colors =
|
||||||
|
|||||||
Reference in New Issue
Block a user