Skip to content

Commit

Permalink
A bit of work on sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
IonutParau committed Oct 25, 2023
1 parent c0ed177 commit ca4198d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 1 deletion.
Binary file added assets/images/destroyers/bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/destroyers/bullet.png~
Binary file not shown.
Binary file added assets/images/destroyers/pistol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/destroyers/pistol.png~
Binary file not shown.
Binary file added assets/images/destroyers/sentry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/destroyers/sentry.png~
Binary file not shown.
7 changes: 6 additions & 1 deletion lib/layout/other/multiplayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class _MultiplayerPageState extends State<MultiplayerPage> {
pingIp += '/';
}

final stopwatch = Stopwatch();
stopwatch.start();

return Container(
padding: EdgeInsets.all(0.5.w),
decoration: BoxDecoration(
Expand All @@ -46,17 +49,19 @@ class _MultiplayerPageState extends State<MultiplayerPage> {
future: http.post(Uri.parse(pingIp)),
builder: (ctx, snap) {
if (snap.hasError) {
stopwatch.stop();
print(snap.error);
return Icon(Icons.error, color: Colors.red["light"]);
}
if (snap.hasData) {
stopwatch.stop();
final response = snap.data!;
if (response.statusCode != 200) {
return Icon(Icons.error, color: Colors.red["light"]);
}
return Icon(
Icons.check_box_rounded,
color: Colors.green["light"],
color: stopwatch.elapsedMilliseconds > 30 ? Colors.yellow["light"] : Colors.green["light"],
);
}
return Icon(FluentIcons.clock, color: Colors.blue);
Expand Down
1 change: 1 addition & 0 deletions lib/layout/other/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ String currentVersion = '2.3.1.0 Configurable';
final List<String> changes = [
"Reworked how TPC puzzle movement are computed",
"Fixed VX implementation being bugged and made it more up-to-date",
"Added Favorite cells",
];

IconData getTrailing(String change) {
Expand Down
26 changes: 26 additions & 0 deletions lib/logic/cell_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ final cells = {
"stable_o",
"anvil",
"flipped_puzzle",
"bullet",
"sentry",
}.toList();

final modded = <String>[];
Expand All @@ -401,6 +403,8 @@ final cursorTextures = ["cursor", ...cells, "invis_tool", "trick_tool"]..removeW
final textureMapBackup = HashMap<String, String>.from(textureMap);

HashMap<String, String> textureMap = HashMap.from({
"sentry.png": "destroyers/sentry.png",
"bullet.png": "destroyers/bullet.png",
"anvil.png": "movers/anvil.png",
"electric_puller.png": "electrical/electric_puller.png",
"stable_a.png": "stableton/stable_a.png",
Expand Down Expand Up @@ -1014,6 +1018,7 @@ final categories = [
"liner",
),
"anvil",
"bullet",
],
"mover",
),
Expand Down Expand Up @@ -1282,6 +1287,7 @@ final categories = [
"fire",
),
"antigen",
"sentry",
],
"trash",
),
Expand Down Expand Up @@ -1580,6 +1586,7 @@ final categories = [
"electric_battery",
"electric_mover",
"electric_puller",
"sentry",
],
"electric_wire",
),
Expand Down Expand Up @@ -3290,6 +3297,14 @@ final cellInfo = <String, CellProfile>{
"Flipped Puzzle",
"A flipped puzzle cell. Movements on one axis (left-right or up-down) will be inverted."
),
"bullet": CellProfile(
"Bullet",
"I have yet to meet someone who can outsmart bullet",
),
"sentry": CellProfile(
"Sentry",
"Will kill enemies or players.",
),
};

enum CellPropertyType {
Expand Down Expand Up @@ -3560,4 +3575,15 @@ Map<String, List<CellProperty>> props = {
CellProperty("Loss Upon Lethal Impact", "How much velocity is lost upon breaking a cell. 0 is no change, 0.3 (default) is 30%, 1 is all velocity lost.", "impact_loss", CellPropertyType.number, 0.3),
CellProperty("Terminal Velocity", "The limit of how fast it can fall downwards.", "speed_limit", CellPropertyType.number, 5),
],
"bullet": [
CellProperty("Speed", "How fast the bullet is", "speed", CellPropertyType.integer, 1),
],
"sentry": [
CellProperty("Shoot Interval", "The interval at which it shoots", "gun_interval", CellPropertyType.number, 2),
CellProperty("Bullet Speed", "The speed of the bullet it shoots", "bullet_speed", CellPropertyType.integer, 1),
CellProperty("Friendly", "If true, it will kill enemies. If not, it will kill puzzle cells and keys. There are also common targets it will kill either way.", "friendly", CellPropertyType.boolean, true),
CellProperty("Power Cost", "The amount of electric power the sentry consumes passively", "passive_cost", CellPropertyType.number, 1),
CellProperty("Shoot Cost", "The amount of electric power the sentry consumes when shooting", "gun_cost", CellPropertyType.number, 5),
CellProperty("Power", "The amount of electric power in the sentry gun", "electric_power", CellPropertyType.number, 500),
],
};

0 comments on commit ca4198d

Please sign in to comment.