-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e82900
commit 55738eb
Showing
5 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/obj/item/card/psyonic_license | ||
name = "psyonic license" | ||
desc = "An official license given to psyonic users by the NanoTrasen Psyonics and Eugenics Division itself." | ||
icon = 'tff_modular/modules/psyonics/icons/card.dmi' | ||
icon_state = "card_psy" | ||
inhand_icon_state = "card-id" | ||
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' | ||
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' | ||
w_class = WEIGHT_CLASS_TINY | ||
pickup_sound = 'sound/items/handling/id_card/id_card_pickup1.ogg' | ||
drop_sound = 'sound/items/handling/id_card/id_card_drop1.ogg' | ||
sound_vary = TRUE | ||
resistance_flags = FIRE_PROOF | ||
var/datum/psyonic_licence_datum/owner_info | ||
|
||
/obj/item/card/psyonic_license/New(mob/living/carbon/human/owner) | ||
. = ..() | ||
owner_info = new(owner) | ||
|
||
/obj/item/card/psyonic_license/ui_interact(mob/user, datum/tgui/ui) | ||
if(!owner_info) | ||
balloon_alert(user, "The card isn't bound to anyone!") | ||
return | ||
|
||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
ui = new(user, src, "PsyonicLicense") | ||
ui.set_autoupdate(FALSE) | ||
ui.open() | ||
|
||
/obj/item/card/psyonic_license/ui_static_data(mob/user) | ||
var/list/data = list() | ||
|
||
data["primary_school"] = owner_info.primary_school | ||
data["secondary_school"] = owner_info.secondary_school | ||
data["psyonic_level"] = owner_info.psyonic_level | ||
data["owner_name"] = owner_info.owner_name | ||
data["owner_age"] = owner_info.owner_age | ||
data["owner_preview"] = owner_info.owner_preview | ||
data["owner_species"] = owner_info.owner_species | ||
|
||
return data | ||
|
||
/datum/psyonic_licence_datum | ||
var/datum/weakref/original_owner | ||
var/owner_name | ||
var/owner_age | ||
var/psyonic_level | ||
var/primary_school | ||
var/secondary_school | ||
var/owner_species | ||
var/icon/owner_preview | ||
|
||
/datum/psyonic_licence_datum/New(mob/living/carbon/human/human_owner) | ||
. = ..() | ||
original_owner = WEAKREF(human_owner) | ||
if(original_owner && original_owner.resolve()) | ||
var/mob/living/carbon/human/owner = original_owner.resolve() | ||
if(!owner.ispsyonic()) | ||
return | ||
var/datum/quirk/psyonic/quirk_holder = owner.get_quirk(/datum/quirk/psyonic) | ||
psyonic_level = quirk_holder.psyonic_level_string | ||
primary_school = quirk_holder.school | ||
secondary_school = quirk_holder.secondary_school | ||
owner_name = owner.real_name | ||
owner_age = owner.age | ||
|
||
if (!owner.dna.species.lore_protected && owner.dna.features["custom_species"]) | ||
owner_species = "[owner.dna.features["custom_species"]]" | ||
else | ||
owner_species = "[owner.dna.species.name]" | ||
|
||
owner_preview = icon2base64(getFlatIcon(owner, SOUTH, no_anim = TRUE)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import { useBackend } from '../backend'; | ||
import { Icon, Image, LabeledList, Section, Stack } from '../components'; | ||
import { Window } from '../layouts'; | ||
|
||
type Data = { | ||
character_preview: string; | ||
primary_school: string; | ||
secondary_school: string; | ||
psyonic_level: string; | ||
owner_name: string; | ||
owner_age: number; | ||
owner_species: string; | ||
owner_preview: string; | ||
}; | ||
|
||
export const PsyonicLicense = (props) => { | ||
const { act, data } = useBackend<Data>(); | ||
const { | ||
primary_school, | ||
secondary_school, | ||
psyonic_level, | ||
owner_name, | ||
owner_age, | ||
owner_species, | ||
owner_preview, | ||
} = data; | ||
return ( | ||
<Window title="Psyonic License" width={625} height={450} theme="ntos"> | ||
<Window.Content> | ||
<Stack minWidth="625px"> | ||
<Stack.Item width="50px"> | ||
<Icon height="100%" fontSize="50px" name="flushed" color="cyan" /> | ||
</Stack.Item> | ||
<Stack.Item width="500px"> | ||
<Section | ||
textAlign="center" | ||
title="ЛИЦЕНЗИЯ ПОЛЬЗОВАТЕЛЯ ПСИОНИКИ" | ||
italic | ||
> | ||
{'Мы всегда наблюдаем'} | ||
</Section> | ||
</Stack.Item> | ||
<Stack.Item width="50px"> | ||
<Icon height="100%" fontSize="50px" name="flushed" color="cyan" /> | ||
</Stack.Item> | ||
</Stack> | ||
<Stack minWidth="625px" verticalAlign="middle"> | ||
<Stack.Item | ||
width="34%" | ||
minWidth="207px" | ||
textAlign="center" | ||
align="center" | ||
> | ||
<Section textAlign="center" align="center" height="200px"> | ||
{/* <Icon name="brain" fontSize="200px" color="cyan" height="100%" /> */} | ||
<Image | ||
fillPositionedParent | ||
width="100%" | ||
height="200px" | ||
opacity={1} | ||
src={`data:image/jpeg;base64,${data.owner_preview}`} | ||
/> | ||
</Section> | ||
</Stack.Item> | ||
<Stack.Item textAlign="center" height="100%"> | ||
<Section title="Информация о владельце" height="200px"> | ||
<LabeledList> | ||
<LabeledList.Item label="ФИО"> | ||
{data.owner_name} | ||
</LabeledList.Item> | ||
<LabeledList.Item label="Возраст"> | ||
{data.owner_age} | ||
</LabeledList.Item> | ||
<LabeledList.Item label="Раса"> | ||
{data.owner_species} | ||
</LabeledList.Item> | ||
<LabeledList.Item label="Первичная школа"> | ||
{data.primary_school} | ||
</LabeledList.Item> | ||
<LabeledList.Item label="Вторичная школа"> | ||
{data.secondary_school} | ||
</LabeledList.Item> | ||
<LabeledList.Item label="Псионический потенциал"> | ||
{data.psyonic_level} | ||
</LabeledList.Item> | ||
</LabeledList> | ||
</Section> | ||
</Stack.Item> | ||
</Stack> | ||
<Stack minWidth="625px"> | ||
<Stack.Item width="100%"> | ||
<Section textAlign="center"> | ||
{ | ||
'Данная лицензия удостоверяет то, что пользователь является псиоником.' | ||
} | ||
{ | ||
' Лицензия пользователя псионики позволяет пользователю применять способности в целях самозащиты, оказания лечебной помощи и в прочих, установленных законом случаев.' | ||
} | ||
{ | ||
' Пользователь псионики обязан иметь лицензию при себе всё время, иначе его действия могут быть классифицированы СБ НТ как нелегальные и повлечь за собой юридические последствия.' | ||
} | ||
</Section> | ||
</Stack.Item> | ||
</Stack> | ||
<Stack> | ||
<Stack.Item> | ||
<Section | ||
textColor="red" | ||
fontWeight="900" | ||
minWidth="625px" | ||
textAlign="center" | ||
> | ||
{'ПОДДЕЛКА ЛИЦЕНЗИИ КАРАЕТСЯ ЗАКОНОМ'} | ||
</Section> | ||
</Stack.Item> | ||
</Stack> | ||
</Window.Content> | ||
</Window> | ||
); | ||
}; |