Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crime Assist pda program #464

Merged
merged 25 commits into from
Dec 29, 2023

Conversation

Timfa2112
Copy link
Contributor

@Timfa2112 Timfa2112 commented Nov 20, 2023

About the PR

Add a Crime Assist program, which helps Security and Lawyer players determine what crime was committed without having to have a wiki open.

Why / Balance

For many players, evidently, reading up on Space Law is an insurmountable obstacle, and as a result they have trouble identifying what is and isn't a crime. For this reason, a PDA program that gives a basic way to see what sort of crime was committed may help.

Technical details

The PDA program is fairly simple. It has a ew buttons (Start, Home, Yes, No) which are visible/invisible depending on the program's State. This State also determines which Localization string is displayed.

Media

image
image
image
image
image
image
image
image

Base flowchart (though I fixed the issue where you're always guilty of Hooliganism)
image
Credit goes to @IcedQuinn for the chart! It's been both very helpful as well as the inspiration for the entire program.

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

🆑

  • Add: Crime Assist program to Security and Lawyer PDA's, to help identify a crime with a simple yes/no question tree.

@Timfa2112 Timfa2112 marked this pull request as draft November 20, 2023 19:38
@github-actions github-actions bot added S: Needs Review Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes: YML Changes any yml files labels Nov 20, 2023
@Timfa2112
Copy link
Contributor Author

Draft because I still need to figure out how to add icons

@IcedQuinn
Copy link

For the record, I made the chart. Though I bless it's usage 👍

I didn't really think about innocent being in there because you wouldn't be sentenced by a warden if you were. But it's a pretty hilarious thought.

Thanks, IcedQuinn!
@github-actions github-actions bot added the Changes: Sprite Changes any png or json in an rsi label Nov 20, 2023
Copy link
Contributor

github-actions bot commented Nov 20, 2023

RSI Diff Bot; head commit 9a1550b merging into 0f15db7
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/DeltaV/Icons/cri.rsi

State Old New Status
cri Added

Resources/Textures/DeltaV/Objects/Devices/cartridge.rsi

State Old New Status
cart-cri Added

Edit: diff updated after 9a1550b

@Timfa2112 Timfa2112 marked this pull request as ready for review November 20, 2023 22:51
@IcedQuinn
Copy link

After talking with Leo in Discord, I've drawn some (more acceptable) candidate sprites also:

space law icon 2 scales
space law icon 2 cuff
space law icon 2

@leonardo-dabepis
Copy link
Contributor

leonardo-dabepis commented Nov 21, 2023

After talking with Leo in Discord, I've drawn some (more acceptable) candidate sprites also:

space law icon 2 scales space law icon 2 cuff space law icon 2

I said I would rather have the sprite just be the base space law book, just to keep it consistent.

EDIT: this isn't too big of a deal though. The first sprite on your list is preferable if you really insist on not using the base space law book.

@Timfa2112
Copy link
Contributor Author

After talking with Leo in Discord, I've drawn some (more acceptable) candidate sprites also:
space law icon 2 scales space law icon 2 cuff space law icon 2

I said I would rather have the sprite just be the base space law book, just to keep it consistent.

EDIT: this isn't too big of a deal though. The first sprite on your list is preferable if you really insist on not using the base space law book.

I happen to have picked the first sprite in the list. I like this one much more than the simplistic book in the game, and I can see an application having a more elaborate book icon than you'd generally see in real life.

That, and I like the way it looks :P

@Timfa2112
Copy link
Contributor Author

Seeing a strange error in the 'Build & Test Debug' step; Caught exception while generating mail: Entity HandcuffsDummy (21731, HandcuffsDummy) is/has been terminated
Having a hard time seeing how any of my changes can cause such a thing, and it didn't happen in the previous run (while I only swapped a .png compared to then). Is it possible the test fails on this randomly due to a bug unrelated to this PR?

@Colin-Tel
Copy link
Contributor

Seeing a strange error in the 'Build & Test Debug' step; Caught exception while generating mail: Entity HandcuffsDummy (21731, HandcuffsDummy) is/has been terminated

it’s unrelated. It has to do with mail tests that are a little finicky. Test packaging has also been failing on all PRs so I wouldn’t worry about it either

@DebugOk
Copy link
Contributor

DebugOk commented Nov 27, 2023

I'll do a proper review of this sometime this week probably

@Timfa2112
Copy link
Contributor Author

I'll do a proper review of this sometime this week probably

Much appreciated, I'll await it patiently :)

Comment on lines 43 to 177
CrimeAssistUiState.UiStates.HappenInCourt => yesPressed ? CrimeAssistUiState.UiStates.Result_ContemptOfCourt : CrimeAssistUiState.UiStates.DuringActiveInvestigation,
CrimeAssistUiState.UiStates.DuringActiveInvestigation => yesPressed ? CrimeAssistUiState.UiStates.Result_ObstructionOfJustice : CrimeAssistUiState.UiStates.ToCommandStaff,
CrimeAssistUiState.UiStates.ToCommandStaff => yesPressed ? CrimeAssistUiState.UiStates.Result_Sedition : CrimeAssistUiState.UiStates.WasItCommandItself,
CrimeAssistUiState.UiStates.WasItCommandItself => yesPressed ? CrimeAssistUiState.UiStates.Result_AbuseOfPower : CrimeAssistUiState.UiStates.Result_Hooliganism,
_ => CrimeAssistUiState.UiStates.MainMenu
};

UpdateUI(newState);
}

public void UpdateUI(CrimeAssistUiState.UiStates state)
{
_currentState = state;
bool isResult = state.ToString().StartsWith("Result");

StartButton.Visible = state == CrimeAssistUiState.UiStates.MainMenu;
YesButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu && !isResult;
NoButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu && !isResult;
HomeButton.Visible = state != CrimeAssistUiState.UiStates.MainMenu;
Explanation.Visible = state != CrimeAssistUiState.UiStates.MainMenu;

Subtitle.Visible = isResult; // Crime severity is displayed here
Punishment.Visible = isResult; // Crime punishment is displayed here

if (!isResult)
{
string question = $"\n[font size=15]{GetQuestionLocString(state)}[/font]";

if (question.ToLower().Contains("sophont"))
{
string sophontExplanation = Loc.GetString("crime-assist-sophont-explanation");
question += $"\n[font size=8][color=#999999]{sophontExplanation}[/color][/font]";
}

Title.SetMarkup(question);
Subtitle.SetMarkup(string.Empty);
Explanation.SetMarkup(string.Empty);
Punishment.SetMarkup(string.Empty);
}
else
{
Title.SetMarkup("\n[bold][font size=23][color=#a4885c]" + GetCrimeNameLocString(state) + "[/color][/font][/bold]");
Subtitle.SetMarkup("\n[font size=19]" + GetCrimeSeverityLocString(state) + "[/font]");
Explanation.SetMarkup("\n[title]" + GetCrimeExplanationLocString(state) + "[/title]\n");
Punishment.SetMarkup("[bold][font size=15]" + GetCrimePunishmentLocString(state) + "[/font][/bold]");
}
}

private string GetQuestionLocString(CrimeAssistUiState.UiStates state)
{
return Loc.GetString($"crime-assist-question-{state.ToString().ToLower()}");
}

private string GetCrimeExplanationLocString(CrimeAssistUiState.UiStates state)
{
return Loc.GetString($"crime-assist-crimedetail-{state.ToString().ToLower().Remove(0, 7)}");
}

private string GetCrimeNameLocString(CrimeAssistUiState.UiStates state)
{
return Loc.GetString($"crime-assist-crime-{state.ToString().ToLower().Remove(0, 7)}");
}

private string GetCrimePunishmentLocString(CrimeAssistUiState.UiStates state)
{
return Loc.GetString($"crime-assist-crimepunishment-{state.ToString().ToLower().Remove(0, 7)}");
}

private string GetCrimeSeverityLocString(CrimeAssistUiState.UiStates state)
{
return state switch
{
CrimeAssistUiState.UiStates.Result_Innocent => "[color=#39a300]" + Loc.GetString("crime-assist-crimetype-innocent") + "[/color]",
CrimeAssistUiState.UiStates.Result_AnimalCruelty => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]",
CrimeAssistUiState.UiStates.Result_Theft => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]",
CrimeAssistUiState.UiStates.Result_Trespass => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]",
CrimeAssistUiState.UiStates.Result_Vandalism => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]",
CrimeAssistUiState.UiStates.Result_Hooliganism => "[color=#7b7b30]" + Loc.GetString("crime-assist-crimetype-misdemeanour") + "[/color]",
CrimeAssistUiState.UiStates.Result_Manslaughter => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony"),
CrimeAssistUiState.UiStates.Result_GrandTheft => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_BlackMarketeering => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Sabotage => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Mindbreaking => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Assault => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_AbuseOfPower => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Possession => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Endangerment => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_BreakingAndEntering => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Rioting => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_ContemptOfCourt => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_PerjuryOrFalseReport => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_ObstructionOfJustice => "[color=#7b5430]" + Loc.GetString("crime-assist-crimetype-felony") + "[/color]",
CrimeAssistUiState.UiStates.Result_Murder => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_Terrorism => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_GrandSabotage => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_Decorporealisation => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_Kidnapping => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_Sedition => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
CrimeAssistUiState.UiStates.Result_SexualHarrassment => "[color=#7b2e30]" + Loc.GetString("crime-assist-crimetype-capital") + "[/color]",
_ => ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if this functioned via yaml or something, as if we ever change splaw the only way to update this is by touching code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would need to learn a bit more about yml for that, but it does sound like a big improvement. I should have time to look into this saturday :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done! Learnt a lot about prototypes while doing it, too

Timfa2112 and others added 2 commits December 8, 2023 14:08
@github-actions github-actions bot added the S: Merge Conflict Fix your PR! label Dec 16, 2023
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the S: Merge Conflict Fix your PR! label Dec 16, 2023
@dvir001
Copy link
Contributor

dvir001 commented Dec 21, 2023

Cant wait to have this added.

Copy link
Contributor

@DebugOk DebugOk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only glanced over it

@DebugOk DebugOk merged commit 11d4a39 into DeltaV-Station:master Dec 29, 2023
DeltaV-Bot pushed a commit that referenced this pull request Dec 29, 2023
@Timfa2112 Timfa2112 deleted the crimeassist-pda-program branch December 29, 2023 20:45
DebugOk pushed a commit to DebugOk/Delta-v that referenced this pull request Jan 20, 2024
* Completely untested first commit

* Get basic program flow working

* Add Innocent

* Add Fancy Rich Text

* Icon

Thanks, IcedQuinn!

* Add Cartridge icons

* New image from IcedQuinn

* Add explanation on what a Sophont is, to be automatically appended to any text referencing a Sophont later on

* Convert tabs to spaces

* remove [bold] tags from loc

* Make text bold again

* Alter formatting, reduce text length for sophont explanation to fit it on the screen

* Update Resources/Locale/en-US/deltav/cartridge-loader/cartridges.ftl

Co-authored-by: Colin-Tel <[email protected]>
Signed-off-by: Tim Falken <[email protected]>

* Add program to more PDA's

* Add a tip about the app

* Recreate flow in yaml

todo: actually load and use this yaml

* Remove the old state machine, and add configurable yaml prototypes to define pages

* Move page to its own file

---------

Signed-off-by: Tim Falken <[email protected]>
Co-authored-by: Colin-Tel <[email protected]>
(cherry picked from commit 11d4a39)
DebugOk pushed a commit to DebugOk/Delta-v that referenced this pull request Jan 20, 2024
Timemaster99 pushed a commit to Timemaster99/Delta-v that referenced this pull request Aug 17, 2024
# Description

During PR DeltaV-Station#464, somehow Moth's got back their ability to move with their
wings whenever the gravity gets shut off. Well, I'm here to correct the
injustice by also putting it on Harpies. In fact, Harpies have a much
bigger claim to it, their wings are absolutely massive compared to
Moths.

# Changelog

:cl:
- add: Harpies remembered that just like moths; they also have wings,
and can zoom whenever the gravity turns off.

Co-authored-by: Danger Revolution! <[email protected]>
ghost pushed a commit that referenced this pull request Aug 27, 2024
* Harpy Peacock Tail (#428)

Courtesy of @StillIcarus

This adds a new Peacock tail marking to Harpies. I'm also taking this
time to update them to the recent DeltaV changes to the birbs.

![image](https://github.com/Simple-Station/Einstein-Engines/assets/16548818/4f776006-700e-4d92-802c-03e6dd201491)

![image](https://github.com/Simple-Station/Einstein-Engines/assets/16548818/5fd143ab-069f-4d1c-b5e0-ee982a95b4b6)

The backside is semi cursed, but that's something I can't do within the
scope of this PR due to sprite system limitations that Death has planned
improvements for. Just ignore them. :)

Have a birb as consolation.

![faridaiscute](https://github.com/Simple-Station/Einstein-Engines/assets/16548818/09373a57-f32f-48eb-b52b-6d12143f62ff)

:cl: VMSolidus
- add: Peacock Tails have been added for Harpies

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: Danger Revolution! <[email protected]>

* Birbs Have Wings Too (#477)

# Description

During PR #464, somehow Moth's got back their ability to move with their
wings whenever the gravity gets shut off. Well, I'm here to correct the
injustice by also putting it on Harpies. In fact, Harpies have a much
bigger claim to it, their wings are absolutely massive compared to
Moths.

# Changelog

:cl:
- add: Harpies remembered that just like moths; they also have wings,
and can zoom whenever the gravity turns off.

Co-authored-by: Danger Revolution! <[email protected]>

* Harpy Sprite Update 3 (#556)

This will be my third sprite update pack for Harpies, with new sprites
courtesy of StillxIcarus (Discord). These include owl wings, and forked
tails. I've also personally made a new "Large Ear Tufts" variation. Many
sprites have been split between Huescale and Whitescale variations, with
Huescale offering greater variety of colors, while Whitescale offers
better pure whites(A notable weakness of having only huescale options
was that white winged harpies ended up a yellow-cream color).

Additionally, I have updated all of the Harpy Hardsuit and Softsuit
variations to now include **Wing Sleeves**, with some hardsuits even
having personalized color schemes for their sleeves, depending on how
important the wearer may be. Of course, all of the syndicate hardsuits
have received their own unique schemes for each suit, including for the
first time a species-specific Elite Syndicate Suit.

![image](https://github.com/user-attachments/assets/f4e90e0d-6869-47de-bd26-a6668f8e3e2b)

![image](https://github.com/user-attachments/assets/ecc98a25-936c-46a4-bddc-ff3a25b27b25)

Additionally, I am taking this as a convenient time to move a majority
of the Harpy files to the core EE Directory, as I am taking direct
responsibility for maintaining my creation here, rather than anywhere
else.

:cl:
- add: Harpy Update 3, New markings for Harpies, all new
species-specific hardsuit & softsuit variations that feature wing
sleeves.

* White Dream Harpy Markings (#696)

ONIKS was kind enough to provide me with several new Harpy markings,
consisting of alternate Bat-wings, Haven Tail, Long Forked Tail, and
Swallow Tail. I have also taken the liberty of actually making a basic
set of "Bionic Wings", which are just a slightly edited version of the
"harpsuit" wing sleeve, including hardsuit lights. Unfortunately due to
limitations in the game's code concerning markings, I couldn't make the
lights use the unshaded shader. This limitation irritates me. I'll
probably fix that in a separate PR.

I actually also received a pack of Arachnid and Felinid sprites! But I'm
going to add those in a different PR entirely.

<details><summary><h1>Media</h1></summary>
<p>

Bionic wings

![image](https://github.com/user-attachments/assets/6acc64a9-be6b-435b-9c61-91287ef65c10)

Bat Wings

![image](https://github.com/user-attachments/assets/e44fe12e-8410-47ca-a4c1-5e644fd36b8a)

Haven tail

![image](https://github.com/user-attachments/assets/2adadcdd-04fc-458d-8491-61bd52a3b4d1)

Swallow tail

![image](https://github.com/user-attachments/assets/615391eb-0314-4e6d-a87b-101d0a307955)

Long Forked Tail

![image](https://github.com/user-attachments/assets/e3d672f7-b8cb-4497-a2a3-87d0c224847d)

</p>
</details>

:cl:
- add: The following new markings have been added for Harpies: Bat
Wings, Simple Bionic Wings, Haven Tail, Swallow tail, and Long Forked
Tail

* Split files

* Harpy Hotfix (Cherry-Pick Broke Things) (#570)

Captain's Carapace inherited HidesHarpyWings because wizden made it
parent off Large outerwear for reasons. I've moved HidesHarpyWings to
only LargeOuterwear that actually have harpy sprites so that this won't
happen again.

![image](https://github.com/user-attachments/assets/84ee06e3-eeeb-4193-8cb0-492bd1d3d82e)

![image](https://github.com/user-attachments/assets/ac9493b3-75e7-4696-b531-18b00d1332a5)

* Uncommented digitigrade inv template

* Removed duplicate locale entry

* Add comment

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: VMSolidus <[email protected]>
Co-authored-by: Danger Revolution! <[email protected]>
LaryNevesPR pushed a commit to LaryNevesPR/Estacao-Andromeda that referenced this pull request Jan 3, 2025
# Description

This ports
Simple-Station/Parkstation-Friendly-Chainsaw#46.
This PR is something I consider a key feature adjacent to Space Wind
Rework and its accompanying updates, and is an essential part of the
space station experience.
In practice, this weirdly enough makes being launched into space a bit
easier to survive, since instead of needing to throw potentially
hundreds of items, you can simply throw enough items to get started
flying in the direction of the station and will eventually float back to
the station.

---

<details><summary><h1>Media</h1></summary>
<p>


https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/5570ef35-16e2-493a-ac35-738f27751346


https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/51fba943-8dce-4265-a9cc-7181155eb8de


https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/cd6c0511-2639-4e14-8160-426ba7f2ba73

---
</p>
</details> 

# Changelog

:cl: DEATHB4DEFEAT
- tweak: Space has suddenly become less dense (objects don't slow down
in space)
- remove: Moths are unable to move in space
- tweak: Moths have way better control in zero gravity environments

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: DEATHB4DEFEAT <[email protected]>
LaryNevesPR pushed a commit to LaryNevesPR/Estacao-Andromeda that referenced this pull request Jan 3, 2025
LaryNevesPR pushed a commit to LaryNevesPR/Estacao-Andromeda that referenced this pull request Jan 3, 2025
# Description

During PR DeltaV-Station#464, somehow Moth's got back their ability to move with their
wings whenever the gravity gets shut off. Well, I'm here to correct the
injustice by also putting it on Harpies. In fact, Harpies have a much
bigger claim to it, their wings are absolutely massive compared to
Moths.

# Changelog

:cl:
- add: Harpies remembered that just like moths; they also have wings,
and can zoom whenever the gravity turns off.

Co-authored-by: Danger Revolution! <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: Sprite Changes any png or json in an rsi Changes: UI Changes: YML Changes any yml files S: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants