-
Notifications
You must be signed in to change notification settings - Fork 2
/
astropad.user.js
executable file
·2208 lines (2016 loc) · 101 KB
/
astropad.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name AstroPad
// @version 0.28.11
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @connect astropad.sunsky.fr
// @match http://mush.vg/*
// @match http://mush.vg/#
// @match http://mush.twinoid.com/*
// @match http://mush.twinoid.com/#
// @match http://mush.twinoid.es/*
// @match http://mush.twinoid.es/#
// @require https://code.jquery.com/jquery-2.2.1.min.js
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @copyright 2012+, Sunsky (inspiration Skildor's scripts), compatibility with Firefox 32+ by badconker, update by LAbare
// @downloadURL https://github.com/badconker/astropad/raw/master/astropad.user.js
// ==/UserScript==
var console = unsafeWindow.console;
var localStorage = unsafeWindow.localStorage;
var Main = unsafeWindow.Main;
Main.AstroPad = createObjectIn(unsafeWindow.Main, { defineAs: 'AstroPad' });
Main.AstroPad.version = GM.info.script.version || "0.28.5"; //For use by other scripts
Main.AstroPad.urlAstro = "http://astropad.sunsky.fr/api.py";
Main.AstroPad.heronames = ['Jin Su', 'Frieda', 'Kuan Ti', 'Janice', 'Roland', 'Hua', 'Paola', 'Chao', 'Finola', 'Stephen', 'Ian', 'Chun', 'Raluca', 'Gioele', 'Eleesha', 'Terrence', 'Derek', 'Andie'];
Main.AstroPad.heronames[-1] = "?";
Main.AstroPad.items = [];
if (window.location.href.indexOf('mush.twinoid.com') != -1) {
Main.AstroPad.language = 'en';
Main.AstroPad.lang = 2;
Main.AstroPad.urlMush = "mush.twinoid.com";
Main.AstroPad.roomNames = ['Bridge', 'Alpha Bay', 'Bravo Bay', 'Alpha Bay 2', 'Nexus', 'Medlab', 'Laboratory', 'Refectory', 'Hydroponic Garden', 'Engine Room',
'Front Alpha Turret', 'Centre Alpha Turret', 'Rear Alpha Turret', 'Front Bravo Turret', 'Centre Bravo Turret', 'Rear Bravo Turret',
'Patrol Ship Tomorrowland', 'Patrol Ship Olive Grove', 'Patrol Ship Yasmin', 'Patrol Ship Wolf', 'Patrol Ship E-Street', 'Patrol Ship Eponine', 'Patrol Ship Carpe Diem', 'Pasiphae',
'Front Corridor', 'Central Corridor', 'Rear Corridor', 'Planet', 'Icarus Bay', 'Alpha Dorm', 'Bravo Dorm',
'Front Storage', 'Centre Alpha Storage', 'Rear Alpha Storage', 'Centre Bravo Storage', 'Rear Bravo Storage', 'Outer Space', 'Limbo'];
Main.AstroPad.roomOrder = [1, 3, 29, 2, 30, 0, 25, 32, 11, 34, 14, 9, 10, 13, 24, 31, 8, 28, 6, 5, 4, 36, 23, 22, 20, 21, 17, 16, 19, 18, 27, 33, 12, 35, 15, 26, 7];
Main.AstroPad.physicalDiseases = ["Acid Reflux", "Black Bite", "Cat Allergy", "Cold", "Extreme Tinnitus", "Flu", "Food Poisoning", "Fungic Infection", "Gastroenteritis", "Junkbumpkinitis", "Migraine", "Mush allergy", "Rejuvenation", "Rubella", "Sepsis", "Sinus Storm", "Skin Inflammation", "Slight Nausea", "Smallpox", "Space Rabies", "Syphilis", "Tapeworm", "Vitamin Deficiency"];
Main.AstroPad.psychologicalDiseases = ["Agoraphobia", "Ailurophobia", "Chronic Vertigo", "Crabism", "Coprolalia", "Chronic Migraine", "Depression", "Paranoia", "Psychotic Episodes", "Spleen", "Vertigo", "Weapon Phobia"];
Main.AstroPad.txt = {
desc: "Inventory Manager developed by Sunsky.",
camera: "Installed camera",
drone: "Drone",
intoxRegExp: /Food Poisoning/,
broken: "Broken",
frozen: "Frozen",
unstable: "Unstable",
hazardous: "Hazardous",
decaying: "Decomposing",
charges: "charge(s)",
effect: "Effect",
effect2: "the effect",
curesTip: /Cures?|cures?|curing/,
curesText: "Cures",
causesTip: /Causes?|causes?|causing/,
causesText: "Causes",
delayRegExp: /within ([0-9]+) to ([0-9]+) cycles/,
chancesRegExp: /([0-9]+)\s*% chance (:|of)/,
chef: "Chef",
botanist: "Botanist",
satisfaction: "satisfaction",
thirsty: "thirsty",
dry: "dry",
diseased: "diseased",
cycles: "cycles",
by: "by",
the: "the",
at: "at",
empty: "Void",
inventory: "INVENTORY",
submit: "Synchronize",
refresh: "Refresh",
list: "Text Format",
show: "Show",
help: "Help",
newPad: "New",
exit: "Exit",
astromodTitle: "Altering AstroPad data",
itemChoice: "Choose an item:",
itemCatMisc: "Miscellaneous",
itemCatTools: "Tools",
itemCatWeaponry: "Weapons",
itemCatDocuments: "Documents",
itemCatFood: "Food",
itemCatPlants: "Plants",
itemCatHealth: "Health",
itemCatExpedition: "Expedition",
itemCatAlien: "Artefacts",
defaultItem: "Item",
addItem: "Add an item",
sendAstromod: "Share",
cancelAstromod: "Cancel",
accessAstromod: "Alter",
changeProperties: "Change properties",
propertyTitle: "Item properties:",
foodEffects: "Food effects:",
addEffect: "Add an effect:",
defaultProperties: "Original/default properties",
applyProperties: "Apply properties",
propertyAP: "Action points",
propertyMP: "Movement points",
propertyHP: "Health points",
propertyMoral: "Moral",
propertyChances: "Chances:",
propertyDelay: "Delay:",
propertyTo: "to",
propertyPlant: "Plant:",
propertyFoodState: "Food state:",
propertyPhysical: "Physical",
propertyPsychological: "Psychological",
titleTxtInventory: "Rooms to share:",
checkAll: "Check all",
uncheckAll: "Uncheck All",
generateTxtInventory: "Generate text inventory",
updateEffect: "Do you want to update the effects ?\n\n(Cancel = update but without the effects)",
greetShareMessage: "Here is the text that you should send to your teammates in order to share your AstroPad.",
greetShareMessage2: "You may set a text for a link by putting it between square brackets right after the link, without spaces. For example, \"http://mush.vg?astroId=XXX&astroKey=YYY[Ship inventory]\" will return <a href='#'>Ship inventory</a>.",
defaultShareMessage: "Hi! I suggest we use the AstroPad to keep our inventory updated.\nYou may install it from this topic: //%t//\nJoin this game's inventory by following this link: //%u//\nTo see the map, follow this link: //%v//\nThanks!",
linkPad: "[Pad]",
linkMap: "[Map]",
helpTopic: "http://twd.io/e/WhgQ0M/0", //Topic explaining how to install the script
changeShareMessage: "Change default message",
helpShareMessage: "You can use the following expressions:<ul><li><b>%t</b> will be replaced by a link to the topic explaining how to install the script;</li><li><b>%u</b> will be replaced by the link to add the AstroPad;</li><li><b>%v</b> will be replaced by the link to the map of the AstroPad.</li></ul><br />A link directly followed by a text between square brackets, without spaces, will be replaced by that text.",
saveShareMessage: "Save",
link: "Do you want to bind Astropad #%1 (which key is %2) to this game?",
unlink: "Do you really want to delete the link between AstroPad #%1 and this game?\nIf you lose the Astropad Key, you cannot get it back.",
newShip: "It seems you are in a new game. Don't forget to create a new AstroPad!",
loading: "Loading…",
credits: "AstroPad v." + Main.AstroPad.version + " — Original sin by Sunsky, passed on by badconker and LAbare.",
foodNote: "Note: Food effects shared by a specialist are kept in memory for the whole ship. The AstroPad cannot reveal a Mush in any way.",
allFoodEffectsTitle: "Known food effects",
allFoodEffectsButton: "Share known food effects",
};
}
else if (window.location.href.indexOf('mush.twinoid.es') != -1) {
Main.AstroPad.language = 'es';
Main.AstroPad.lang = 3;
Main.AstroPad.urlMush = "mush.twinoid.es";
Main.AstroPad.roomNames = ['Puente de mando', 'Plataforma Alpha', 'Plataforma Beta', 'Plataforma Alpha 2', 'Nexus', 'Enfermería', 'Laboratorio', 'Comedor', 'Jardín Hidropónico', 'Sala de motores',
'Cañón Alpha delantero', 'Cañón Alpha central', 'Cañón Alpha trasero', 'Cañón Beta delantero', 'Cañón Beta central', 'Cañón Beta trasero',
'Patrullero Longane', 'Patrullero Jujube', 'Patrullero Tamarindo', 'Patrullero Sócrates', 'Patrullero Epicuro', 'Patrullero Platón', 'Patrullero Wallis', 'Pasiphae',
'Pasillo delantero', 'Pasillo central', 'Pasillo trasero', 'Planeta', 'Icarus', 'Dormitorio Alpha', 'Dormitorio Beta',
'Almacén delantero', 'Almacén Alpha central', 'Almacén Alpha trasero', 'Almacén Beta central', 'Almacén Beta trasero', 'Espacio infinito', 'El limbo'];
Main.AstroPad.roomOrder = [32, 33, 34, 35, 31, 11, 10, 12, 14, 13, 15, 7, 29, 30, 5, 36, 28, 8, 6, 4, 25, 24, 26, 23, 20, 17, 16, 21, 19, 18, 22, 27, 1, 3, 2, 0, 9];
Main.AstroPad.physicalDiseases = ["Alergia a los gatos", "Alergia al Mush", "Carencia de vitaminas", "Citroiditis", "Enverdecimiento", "Erupción cutánea", "Gastroenteritis", "Gripe", "Infección aguda", "Infección fúngica", "Intoxicación alimentaria", "Migraña", "Mordida negra", "Náusea Ligera", "Rabia espacial", "Reflujos gástricos", "Resfrío", "Rubéola", "Sífilis", "Solitaria", "Tormenta sinusal", "Virulea", "Zumbido extremo"];
Main.AstroPad.psychologicalDiseases = ["Acceso psicótico", "Agorafobia", "Ailurofobia", "Bazo", "Coprolalia", "Crabismo", "Crisis de paranoia", "Depresión", "Mareo", "Mareo crónico", "Migraña crónica", "Temor a las armas"];
Main.AstroPad.txt = {
desc: "Gestor de inventario desarrollado por Sunsky. Traducción xxbrut0xx y Guilherande.",
camera: "Cámara instalada",
drone: "Dron",
intoxRegExp: /Intoxicación alimentaria/,
broken: "Roto",
frozen: "Congelado",
unstable: "Sospechosa",
hazardous: "Nociva",
decaying: "Toxica",
charges: "carga(s)",
effect: "Efectos",
effect2: "los efectos",
curesTip: /(Curar?|curar?) (la enfermedad)?/,
curesText: "Cura",
causesTip: /(Provocar?|provocar?) la enfermedad/,
causesText: "Provoca",
delayRegExp: /en un plazo de ([0-9]+) a ([0-9]+) ciclos/,
chancesRegExp: /([0-9]+)\s*% de probabilidades\s*:/,
chef: "Chef",
botanist: "Botanista",
satisfaction: "saciedad",
thirsty: "sedienta",
dry: "seca",
diseased: "enferma",
cycles: "ciclos",
by: "por",
the: "el",
at: "a las",
empty: "Vacío",
inventory: "INVENTARIO",
submit: "Sincronizar",
refresh: "Actualizar",
list: "Formato Texto",
show: "Visualizar",
help: "Ayuda",
newPad: "Nuevo",
exit: "Quitar",
astromodTitle: "Modificación del AstroPad",
itemChoice: "Elijan un item:",
itemCatMisc: "Variado",
itemCatTools: "Herramientas",
itemCatWeaponry: "Armas",
itemCatDocuments: "Documentos",
itemCatFood: "Comida",
itemCatPlants: "Plantas",
itemCatHealth: "Salud",
itemCatExpedition: "Expedición",
itemCatAlien: "Artefactos",
defaultItem: "Item",
addItem: "Añadir un item",
sendAstromod: "Compartir",
cancelAstromod: "Cancelar",
accessAstromod: "Modificar",
changeProperties: "Modificar los atributos",
propertyTitle: "Atributos del item:",
foodEffects: "Efectos nutritivos:",
addEffect: "Añadir un efecto:",
defaultProperties: "Atributos originales/por defecto",
propertyAP: "Puntos de acción",
propertyMP: "Puntos de movimiento",
propertyHP: "Puntos de vida",
propertyMoral: "Ánimo",
applyProperties: "Asignar los atributos",
propertyChances: "Probabilidad:",
propertyDelay: "Plazo:",
propertyTo: "a",
propertyPlant: "Planta:",
propertyFoodState: "Caducidad:",
propertyPhysical: "Física",
propertyPsychological: "Psicológica",
titleTxtInventory: "Cuartos para compartir:",
checkAll: "Seleccionar todo",
uncheckAll: "Deseleccionar todo",
generateTxtInventory: "Generar texto de inventario",
updateEffect: "¿Desea actualizar los efectos? \n\n (Cancelar = actualizadas pero sin los efectos)",
greetShareMessage: "Aqui está la prueba a ofrecer a vuestros compañeros de equipo para compartir vuestro AstroPad.",
greetShareMessage2: "You may set a text for a link by putting it between square brackets right after the link, without spaces. For example, \"http://mush.vg?astroId=XXX&astroKey=YYY[Ship inventory]\" will return <a href='#'>Ship inventory</a>.",
defaultShareMessage: "¡Hola! Le sugiero usar AstroPad para el inventario.\nPara instalar el script, lea este tema : //%t//\nPara añadir este astropad, siga este enlace: //%u//\nPara ver el mapa, siga este enlace : //%v//\n¡Gracias!",
linkPad: "[AstroPad]",
linkMap: "[Mapa]",
helpTopic: "http://twd.io/e/VNgQ0M/0",
changeShareMessage: "Modificar el mensaje por defecto",
helpShareMessage: "Puede itilizar las expresiones siguientes:<br /><ul><li><b>%t</b> será reemplazado por el enlace hacia el tópico explicando como instalar el script;</li><li><b>%u</b> será reemplazado por el enlace para añadir el AstroPad;</li><li><b>%v</b> será reemplazado por el enlace hacia la mapa del AstroPad.</li></ul><br />A link directly followed by a text between square brackets, without spaces, will be replaced by that text.",
saveShareMessage: "Registrar",
link: "¿Deseas vincular el AstroPad n°%1 (cuya clave es %2) a la partida?",
unlink: "¿Estás seguro que quieres eliminar el enlace entre el AstroPad n°%1 y la partida ?\nSi pierde la clave relativa a su partida, no será capaz de encontrarla.",
newShip: "Parece que usted comenzó una nueva partida. ¡Considere la creación de un nuevo AstroPad!",
loading: "Cargando…",
credits: "AstroPad v." + Main.AstroPad.version + " — Pecado original por Sunsky, transmitido por badconker y LAbare.",
foodNote: "Nota: los efectos nutritivos compartidos por un especialista se quedarán en memoria para todo la nave. AstroPad no permite en ningún caso detectar Mush.",
allFoodEffectsTitle: "Efectos nutritivos conocidos",
allFoodEffectsButton: "Compartir los efectos nutritivos conocidos",
};
}
else {
Main.AstroPad.language = '';
Main.AstroPad.lang = 1;
Main.AstroPad.urlMush = "mush.vg";
Main.AstroPad.roomNames = ['Pont', 'Baie Alpha', 'Baie Beta', 'Baie Alpha 2', 'Nexus', 'Infirmerie', 'Laboratoire', 'Réfectoire', 'Jardin Hydroponique', 'Salle des moteurs',
'Tourelle Alpha avant', 'Tourelle Alpha centre', 'Tourelle Alpha arrière', 'Tourelle Beta avant', 'Tourelle Beta centre', 'Tourelle Beta arrière',
'Patrouilleur Longane', 'Patrouilleur Jujube', 'Patrouilleur Tamarin', 'Patrouilleur Socrate', 'Patrouilleur Epicure', 'Patrouilleur Planton', 'Patrouilleur Wallis', 'Pasiphae',
'Couloir avant', 'Couloir central', 'Couloir arrière', 'Planète', 'Baie Icarus', 'Dortoir Alpha', 'Dortoir Beta',
'Stockage Avant', 'Stockage Alpha centre', 'Stockage Alpha arrière', 'Stockage Beta centre', 'Stockage Beta arrière', 'Espace infini', 'Les Limbes'];
Main.AstroPad.roomOrder = [1, 3, 2, 28, 26, 24, 25, 29, 30, 36, 5, 8, 6, 4, 23, 20, 17, 16, 21, 19, 18, 22, 27, 0, 7, 9, 33, 32, 31, 35, 34, 12, 10, 11, 15, 13, 14];
Main.AstroPad.physicalDiseases = ["Acouphènes Extrême", "Allergie au chat", "Allergie au mush", "Carence en vitamines", "Citrouillite", "Éruption cutanée", "Gastro Entérite", "Grippe", "Infection aïgue", "Infection fongique", "Intoxication alimentaire", "Migraine", "Morsure Noire", "Nausée légère", "Rage spatiale", "Reflux Gastriques", "Rhume", "Rubéole", "Syphilis", "Tempête sinusale", "Variole", "Verdoiement", "Vers Solitaire"];
Main.AstroPad.psychologicalDiseases = ["Agoraphobie", "Ailurophobie", "Coprolalie", "Crabisme", "Crise Paranoïaque", "Dépression", "Episodes Psychotiques", "Migraine chronique", "Phobie des armes", "Spleen", "Vertige", "Vertige chronique"];
Main.AstroPad.txt = {
desc: "Gestionnaire d'inventaire développé par Sunsky.",
camera: "Caméra installée",
drone: "Drone",
intoxRegExp: /Intoxication Alimentaire/,
broken: "Cassé(e)",
frozen: "Congelé",
unstable: "Instable",
hazardous: "Avariée",
decaying: "Décomposée",
charges: "charge(s)",
effect: "Effets",
effect2: "les effets",
curesTip: /(Guérie|guérir) (la maladie)?/,
curesText: "Guérit",
causesTip: /(Provoquer?|provoquer?|Donner?|donner?) la maladie/,
causesText: "Provoque",
delayRegExp: /dans un délai de ([0-9]+) à ([0-9]+) cycle/,
chancesRegExp: /([0-9]+)\s*% de chances (:|de)/,
chef: "Cuistot",
botanist: "Botaniste",
satisfaction: "satiété",
thirsty: "assoiffé",
dry: "desséché",
diseased: "malade",
cycles: "cycles",
by: "par",
the: "le",
at: "à",
empty: "Vide",
inventory: "INVENTAIRE",
submit: "Synchroniser",
refresh: "Rafraîchir",
list: "Format texte",
show: "Visualiser",
help: "Aide",
newPad: "Nouveau",
exit: "Quitter",
astromodTitle: "Modification de l'AstroPad",
itemChoice: "Choix d'item :",
itemCatMisc: "Vrac",
itemCatTools: "Outils",
itemCatWeaponry: "Armes",
itemCatDocuments: "Documents",
itemCatFood: "Nourriture",
itemCatPlants: "Plantes",
itemCatHealth: "Santé",
itemCatExpedition: "Expédition",
itemCatAlien: "Artefacts",
defaultItem: "Item",
addItem: "Ajouter un item",
sendAstromod: "Partager",
cancelAstromod: "Annuler",
accessAstromod: "Modifier",
changeProperties: "Modifier les attributs",
propertyTitle: "Attributs de l'item :",
foodEffects: "Effets nutritifs :",
addEffect: "Ajouter un effet :",
defaultProperties: "Attributs originaux/par défaut",
applyProperties: "Affecter ces attributs",
propertyAP: "Points d'action",
propertyMP: "Points de mouvement",
propertyHP: "Points de vie",
propertyMoral: "Moral",
propertyChances: "Probabilité :",
propertyDelay: "Délai :",
propertyTo: "à",
propertyPlant: "Plante :",
propertyFoodState: "Péremption :",
propertyPhysical: "Physiologique",
propertyPsychological: "Psychologique",
titleTxtInventory: "Salles à partager :",
checkAll: "Tout cocher",
uncheckAll: "Tout décocher",
generateTxtInventory: "Générer l'inventaire texte",
updateEffect: "Voulez-vous mettre à jour les effets ?\n\n(Annuler = mise à jour quand même mais sans les effets)",
greetShareMessage: "Voici le texte à fournir à vos coéquipiers pour partager votre AstroPad.",
greetShareMessage2: "Vous pouvez assigner un texte à un lien en le mettant entre crochets juste ensuite, sans espace. Par exemple, \"http://mush.vg?astroId=XXX&astroKey=YYY[Inventaire du vaisseau]\" donnera <a href='#'>Inventaire du vaisseau</a>.",
defaultShareMessage: "Bonjour ! Je vous propose d'utiliser l'AstroPad pour l'inventaire.\nPour installer le script, lisez ce topic : //%t//\nPour ajouter cet astropad, suivez ce lien : //%u//\nPour voir la carte, suivez ce lien : //%v//\nMerci !",
linkPad: "[AstroPad]",
linkMap: "[Carte]",
helpTopic: "http://twd.io/e/UxgQ0M/0",
changeShareMessage: "Modifier le message par défaut",
helpShareMessage: "Vous pouvez utiliser les expressions suivantes :<br /><ul><li><b>%t</b> sera remplacé par le lien vers le topic expliquant comment installer le script ;</li><li><b>%u</b> sera remplacé par le lien d'ajout de l'AstroPad ;</li><li><b>%v</b> sera remplacé par le lien vers la carte de l'AstroPad.</li></ul><br />Un lien directement suivi d'un texte entre crochets, sans espace, sera remplacé par ce texte.",
saveShareMessage: "Sauvegarder",
link: "Voulez-vous lier l'AstroPad n°%1 (dont la clé est %2) à cette partie ?",
unlink: "Voulez-vous vraiment supprimer le lien entre l'AstroPad n°%1 et cette partie ?\nSi vous perdez la clé relative à votre partie, vous ne serez plus en mesure de la retrouver.",
newShip: "Il semblerait que vous ayiez commencé une nouvelle partie. Pensez à recréer un AstroPad !",
loading: "Chargement en cours…",
credits: "AstroPad v." + Main.AstroPad.version + " — Péché originel par Sunsky, transmis par badconker et LAbare.",
foodNote: "Note : Les effets nutritifs partagés par un spécialiste restent en mémoire pour tout le vaisseau. L'AstroPad ne permet en aucun cas de détecter un Mush.",
allFoodEffectsTitle: "Effets nutritifs connus",
allFoodEffectsButton: "Partager les effets nutritifs connus",
};
}
Main.AstroPad.allItems = {
//id: ["category", "French name", "English name", "Spanish name", { default food effects or empty }, "food type ('pill', 'food' or 'fruit') for canRead*() or empty"]
super_map: ["alien", "Morceau de carte stellaire", "Starmap Fragment", "Trozo de Mapa Estelar", {}, ""], alien_holographic_tv: ["alien", "Télé Holographique alien", "Alien Holographic TV", "Televisión Alien", {}, ""], alien_oil: ["alien", "Lubrifiant Alien", "Jar of Alien Oil", "Lubricante Alien", {}, ""], computer_jelly: ["alien", "Gelée à Circuits Imprimés", "Printed Circuit Jelly", "Pomada Refrescante", {}, ""], insectoid_shell: ["alien", "Cartouche Invertébré", "Invertebrate Shell", "Proyectil Invertebrado", {}, ""], magellan_liquid_map: ["alien", "Carte Liquide de Magellan", "Magellan Liquid Map", "Mapa Líquido de Magallanes", {}, ""], water_stick: ["alien", "Batonnet Aqueux", "Water Stick", "Barrilla acuosa", {}, ""],
document: ["documents", "Document", "Document", "Documento", {}, ""], postit: ["documents", "Pense-Bête", "Post-it", "Taco de post-it", {}, ""], postit_bloc: ["documents", "Bloc de Pense-Bête", "Block of Post-it Notes", "Bloc de Notas", {}, ""], blueprint_0: ["documents", "Plan du Casque de Visée", "Blueprint: Sniper Helmet", "Plano: Casco de tiro", {}, ""], blueprint_1: ["documents", "Plan du Drapeau Blanc", "Blueprint: White Flag", "Plano: Bandera blanca", {}, ""], blueprint_2: ["documents", "Plan du Drone de Soutien", "Blueprint: Support Drone", "Plano: Dron de apoyo", {}, ""], blueprint_3: ["documents", "Plan de l'EchoLocateur", "Blueprint: EchoLocator", "Plano: Eco-Localizador", {}, ""], blueprint_4: ["documents", "Plan de l'Extincteur", "Blueprint: Extinguisher", "Plano: Extintor", {}, ""], blueprint_5: ["documents", "Plan de la Grenade", "Blueprint: Grenade", "Plano: Granada", {}, ""], blueprint_6: ["documents", "Plan du Lance-Roquette", "Blueprint: Rocket Launcher", "Plano: Lanza-misiles", {}, ""], blueprint_7: ["documents", "Plan du Lizaro Jungle", "Blueprint: Lizaro Jungle", "Plano: Lizaro Jungle", {}, ""], blueprint_8: ["documents", "Plan du Module Babel", "Blueprint: Babel Module", "Plano: Módulo Babel", {}, ""], blueprint_9: ["documents", "Plan du Sofa Suédois", "Blueprint: Swedish Sofa", "Plano: Sofá sueco", {}, ""], blueprint_10: ["documents", "Plan de la Sulfateuse", "Blueprint: Old Faithful", "Plano: Sulfatosa", {}, ""], blueprint_11: ["documents", "Plan du ThermoSenseur", "Blueprint: Thermosensor", "Plano: TermoSensor", {}, ""], blueprint_12: ["documents", "Plan du Vaguoscope", "Blueprint: Oscilloscope", "Plano: Olascopio", {}, ""], book_0: ["documents", "Apprentron : Astrophysicien", "Mage Book : Astrophysicist", "Librotron : Astrofísico", {}, ""], book_1: ["documents", "Apprentron : Biologiste", "Mage Book : Biologist", "Librotron : Biólogo", {}, ""], book_2: ["documents", "Apprentron : Botaniste", "Mage Book : Botanist", "Librotron : Botánico", {}, ""], book_3: ["documents", "Apprentron : Cuistot", "Mage Book : Chef", "Librotron : Chef", {}, ""], book_4: ["documents", "Apprentron : Diplomatie", "Mage Book : Diplomat", "Librotron : Diplomático", {}, ""], book_5: ["documents", "Apprentron : Expert radio", "Mage Book : Radio Expert", "Librotron : Experto en comunicaciones", {}, ""], book_6: ["documents", "Apprentron : Informaticien", "Mage Book : IT Expert", "Librotron : Informático", {}, ""], book_7: ["documents", "Apprentron : Logistique", "Mage Book : Logistics Expert", "Librotron : Logística", {}, ""], book_8: ["documents", "Apprentron : Médecin", "Mage Book : Medic", "Librotron : Médico", {}, ""], book_9: ["documents", "Apprentron : Pilote", "Mage Book : Pilot", "Librotron : Piloto", {}, ""], book_10: ["documents", "Apprentron : Pompier", "Mage Book : Firefighter", "Librotron : Bombero", {}, ""], book_11: ["documents", "Apprentron : Psy", "Shrink Mage Book", "Librotron : Psicólogo", {}, ""], book_12: ["documents", "Apprentron : Robotiques", "Robotics Expert Mage Book", "Librotron : Ing. Robótico", {}, ""], book_13: ["documents", "Apprentron : Sprinter", "Mage Book : Sprinter", "Librotron : Velocista", {}, ""], book_14: ["documents", "Apprentron : Technicien", "Mage Book : Technician", "Librotron : Técnico", {}, ""], book_15: ["documents", "Apprentron : Tireur", "Mage Book : Shooter", "Librotron : Artillero", {}, ""], book_16: ["documents", "De la Recherche sur le Mush.", "Mush Research Review", "Estudio sobre los Mush.", {}, ""], book_17: ["documents", "Manuel du commandant", "Commander's Manual", "Manual del Comandante", {}, ""],
space_suit: ["expedition", "Combinaison", "Spacesuit", "Traje espacial", {}, ""], driller: ["expedition", "Foreuse", "Drill", "Taladro", {}, ""], quad_compass: ["expedition", "Boussole quadrimetric", "Quadrimetric Compass", "Brújula Cuadrimétrica", {}, ""], rope: ["expedition", "Corde", "Rope", "Cuerda", {}, ""], echo_sounder: ["expedition", "EchoLocateur", "EchoLocator", "Eco-Localizador", {}, ""], heat_seeker: ["expedition", "ThermoSenseur", "Thermosensor", "TermoSensor", {}, ""], trad_module: ["expedition", "Module Babel", "Babel Module", "Módulo Babel", {}, ""], white_flag: ["expedition", "Drapeau blanc", "White Flag", "Bandera blanca", {}, ""],
ration_5: ["food", "Steack alien", "Alien Steak", "Bistec Alien", { foodEffects: [{ type: 'pa', value: 4 }, { type: 'moral', value: -1 }, { type: 'satisfaction', value: 4 }, { type: 'causes', value: ["", "Reflux Gastriques", "Acid Reflux", "Reflujos gástricos"][Main.AstroPad.lang], chances: 50, delay: '4-8' }, { type: 'causes', value: ["", "Vers Solitaire", "Tapeworm", "Solitaria"][Main.AstroPad.lang], chances: 25, delay: '4-8' }] }, "food"], ration_0: ["food", "Ration standard", "Standard Ration", "Ración Estándar", { foodEffects: [{ type: 'pa', value: 4 }, { type: 'moral', value: -1 }, { type: 'satisfaction', value: 4 }] }, "food"], ration_1: ["food", "Ration cuisinée", "Cooked Ration", "Ración Cocinada", { foodEffects: [{ type: 'pa', value: 4 }, { type: 'satisfaction', value: 4 }] }, "food"], ration_7: ["food", "Café", "Coffee", "Café", { foodEffects: [{ type: 'pa', value: 2 }] }, "food"], ration_2: ["food", "Riz soufflé proactif", "Proactive Puffed Rice", "Cereal Proactivo", { foodEffects: [{ type: 'pa', value: 10 }, { type: 'satisfaction', value: 5 }] }, "all"], ration_3: ["food", "Patate spatiale", "Space Potato", "Patata Espacial", { foodEffects: [{ type: 'pa', value: 8 }, { type: 'satisfaction', value: 8 }] }, "all"], ration_4: ["food", "Barre de Lombrics", "Lombrick Bar", "Barra de Lombrices", { foodEffects: [{ type: 'pa', value: 6 }, { type: 'moral', value: 2 }, { type: 'satisfaction', value: 8 }] }, "all"], ration_8: ["food", "Barre Supravitaminée", "SuperVitamin Bar", "Barra Supervitaminada", { foodEffects: [{ type: 'pa', value: 8 }, { type: 'pm', value: 4 }, { type: 'satisfaction', value: 6 }, { type: 'causes', value: ["", "Nausée légère", "Slight Nausea", "Náusea Ligera"][Main.AstroPad.lang], chances: 55 }] }, "all"], coffee_thermos: ["food", "Thermos de Café", "Thermos of Coffee", "Termo con Café", { charges: 4 }, ""], lunchbox: ["food", "Panier Repas", "Lunchbox", "Canasta de comida", { charges: 3 }, ""], ration_9: ["food", "Déchets Organiques", "Organic Waste", "Desechos orgánicos", { foodEffects: [{ type: 'pa', value: 6 }, { type: 'moral', value: -4 }, { type: 'satisfaction', value: 16 }] }, "food"],
bandage: ["health", "Bandage", "Bandage", "Vendaje", {}, ""], medikit: ["health", "Médikit", "Medikit", "Medikit", {}, ""], pill_box: ["health", "Kit de survie", "Survival Kit", "Kit de supervivencia", { charges: 3 }, ""], drug_0: ["health", "Twïnoid", "Twinoid", "Twinoid", {}, "pill"], drug_1: ["health", "Xenox", "Xenox", "Xenox", {}, "pill"], drug_2: ["health", "Rixolam", "Phuxx", "Risolam", {}, "pill"], drug_3: ["health", "Eufurysant", "Eufurylate", "Euforidyl", {}, "pill"], drug_4: ["health", "Soma", "Soma", "Macamaca", {}, "pill"], drug_5: ["health", "Epice", "Spyce", "Nuke", {}, "pill"], drug_6: ["health", "Nuke", "Newke", "Japiyú", {}, "pill"], drug_7: ["health", "Ponay", "Pinq", "Ñapepa", {}, "pill"], drug_8: ["health", "Bacta", "Bacta", "Betapropyl", {}, "pill"], drug_9: ["health", "Betapropyl", "Betapropyl", "Pimp", {}, "pill"], drug_10: ["health", "Pimp", "Pymp", "Ontoy", {}, "pill"], drug_11: ["health", "Rosebud", "Rosebud", "Ming", {}, "pill"], ration_6: ["health", "Anabolisant", "Anabolic", "Anabólicos", { foodEffects: [{ type: 'pm', value: 8 }] }, "food"],
spore_extractor: ["misc", "Suceur de Spore", "Spore Sucker", "Extractor de Esporas", {}, ""], anti_mush_serum: ["misc", "Sérum Rétro-Fongique", "Retro-Fungal Serum", "Antídoto Retrofúngico", {}, ""], apron: ["misc", "Tablier intachable", "Stainproof Apron", "Mandil anti-manchas", {}, ""], mush_floppy_disk: ["misc", "Disquette du Génome Mush", "Mush Genome Disk", "Diskette Del Genoma Mush", {}, ""], mush_sample: ["misc", "Souche de test Mush", "Mush Sample", "Muestra De Raíz Mush", {}, ""], myco_alarm: ["misc", "Myco-Alarme", "Myco-Alarm", "MycoAlarma", {}, ""], body_cat: ["misc", "Schrödinger", "Schrödinger", "Schrödinger", {}, ""], help_drone: ["misc", "Drone de Soutien", "Support Drone", "Dron", {}, ""], freezer: ["misc", "Supergélateur", "Superfreezer", "Supergelador", {}, ""], microwave: ["misc", "Micro-onde", "Microwave", "Microondas", { charges: 4 }, ""], sofa: ["misc", "Sofa Suédois", "Swedish Sofa", "Sofá Sueco", {}, ""], plastenite_armor: ["misc", "Armure de plastenite", "Plastenite Armor", "Armadura De Plastenita", {}, ""], soap: ["misc", "Savon", "Soap", "Jabón", {}, ""], super_soap: ["misc", "Super Savon", "Super Soaper", "Jabón mushicida", {}, ""], metal_scraps: ["misc", "Débris métallique", "Scrap Metal", "Pieza metálica", {}, ""], plastic_scraps: ["misc", "Débris plastique", "Plastic Scraps", "Pieza plástica", {}, ""], space_capsule: ["misc", "Capsule Spatiale", "Space Capsule", "Cápsula Espacial", {}, ""], fuel_capsule: ["misc", "Capsule de Fuel", "Fuel Capsule", "Cápsula De Combustible", {}, ""], oxy_capsule: ["misc", "Capsule d'Oxygène", "Oxygen Capsule", "Cápsula De Oxígeno", {}, ""], thick_tube: ["misc", "Tube épais", "Thick Tube", "Tubo grueso", {}, ""], duck_tape: ["misc", "Ruban Adhésif", "Duct Tape", "Cinta adhesiva", {}, ""], mad_kube: ["misc", "MAD Kube", "MAD Kube", "MAD Kube", {}, ""], old_shirt: ["misc", "Vieux T-Shirt", "Old T-Shirt", "Vieja camiseta", {}, ""], printer: ["misc", "Tabulatrice", "Tabulatrix", "Tabuladora", {}, ""],
fruit_tree00: ["plants", "Bananier", "Banana Tree", "Árbol plátano", {}, ""], young_fruit_tree00: ["plants", "Jeune Bananier", "Young Banana Tree", "Joven Árbol plátano", {}, ""], fruit_tree01: ["plants", "Lianiste", "Creepist", "Lianesto", {}, ""], young_fruit_tree01: ["plants", "Jeune Lianiste", "Young Creepist", "Joven Lianesto", {}, ""], fruit_tree02: ["plants", "Cactuor", "Cactax", "Cactour", {}, ""], young_fruit_tree02: ["plants", "Jeune Cactuor", "Young Cactax", "Joven Cactour", {}, ""], fruit_tree03: ["plants", "Bifalon", "Bifflon", "Bifalón", {}, ""], young_fruit_tree03: ["plants", "Jeune Bifalon", "Young Bifflon", "Joven Bifalón", {}, ""], fruit_tree04: ["plants", "Poulmino", "Pulminagro", "Pulmino", {}, ""], young_fruit_tree04: ["plants", "Jeune Poulmino", "Young Pulminagro", "Joven Pulmino", {}, ""], fruit_tree05: ["plants", "Precatus", "Precatus", "Precatia", {}, ""], young_fruit_tree05: ["plants", "Jeune Precatus", "Young Precatus", "Joven Precatia", {}, ""], fruit_tree06: ["plants", "Buitalien", "Buttalien", "Buitalien", {}, ""], young_fruit_tree06: ["plants", "Jeune Buitalien", "Young Buttalien", "Joven Buitalien", {}, ""], fruit_tree07: ["plants", "Platacia", "Platacia", "Platacia", {}, ""], young_fruit_tree07: ["plants", "Jeune Platacia", "Young Platacia", "Joven Platacia", {}, ""], fruit_tree08: ["plants", "Tubiliscus", "Tubiliscus", "Tubiliscus", {}, ""], young_fruit_tree08: ["plants", "Jeune Tubiliscus", "Young Tubiliscus", "Joven Tubiliscus", {}, ""], fruit_tree09: ["plants", "Peuplimoune", "Graapshoot", "Poplimuno", {}, ""], young_fruit_tree09: ["plants", "Jeune Peuplimoune", "Young Graapshoot", "Joven Poplimuno", {}, ""], fruit_tree10: ["plants", "Fiboniccus", "Fiboniccus", "Fibonicio", {}, ""], young_fruit_tree10: ["plants", "Jeune Fiboniccus", "Young Fiboniccus", "Joven Fibonicio", {}, ""], fruit_tree11: ["plants", "Mycopia", "Mycopia", "Mycopia", {}, ""], young_fruit_tree11: ["plants", "Jeune Mycopia", "Young Mycopia", "Joven Mycopia", {}, ""], fruit_tree12: ["plants", "Asperginulk", "Asperagunk", "Asperginulk", {}, ""], young_fruit_tree12: ["plants", "Jeune Asperginulk", "Young Asperagunk", "Joven Asperginulk", {}, ""], fruit_tree13: ["plants", "Cucurbitatrouille", "Bumpjunkin", "Cucurbitacia", {}, ""], young_fruit_tree13: ["plants", "Jeune Cucurbitatrouille", "Young Bumpjunkin", "Joven Cucurbitacia", {}, ""], fruit00: ["plants", "Banane", "Banana", "Plátano", { foodEffects: [{ type: 'pa', value: 1 }, { type: 'moral', value: 1 }, { type: 'hp', value: 1 }, { type: 'satisfaction', value: 1 }] }, "fruit"], fruit01: ["plants", "Lianube", "Creepnut", "Lianuba", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit02: ["plants", "Balargine", "Meztine", "Balargina", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit03: ["plants", "Goustiflon", "Guntiflop", "Gustiflón", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit04: ["plants", "Toupimino", "Ploshmina", "Tupimino", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit05: ["plants", "Precati", "Precati", "Precatia", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit06: ["plants", "Bottine", "Bottine", "Botino", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit07: ["plants", "Fragilane", "Fragilane", "Fragilana", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit08: ["plants", "Anémole", "Anemole", "Anémola", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit09: ["plants", "Pénicule", "Peniraft", "Peniclo", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit10: ["plants", "Kubinus", "Kubinus", "Kubinus", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit11: ["plants", "Calebotte", "Caleboot", "Calebota", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit12: ["plants", "Filandru", "Filandra", "Filandru", { foodEffects: [{ type: 'satisfaction', value: 1 }] }, "fruit"], fruit13: ["plants", "Citrouïd", "Jumpkin", "Citroida", { foodEffects: [{ type: 'pa', value: 3 }, { type: 'moral', value: 1 }, { type: 'hp', value: 1 }] }, "fruit"], tree_pot: ["plants", "HydroPot", "HydroPot", "Hydromaceta", {}, ""],
camera: ["tools", "Caméra", "Camera", "Cámara", {}, ""], camera_installed: ["tools", "Caméra installée", "Installed camera", "Cámara instalada", {}, ""], extinguisher: ["tools", "Extincteur", "Extinguisher", "Extintor", {}, ""], hacker_kit: ["tools", "Bidouilleur", "Hacker Kit", "Kit de Hackeo", {}, ""], aiming_helmet: ["tools", "Casque de Visée", "Sniper's Helmet", "Casco de tiro", {}, ""], ncc_lens: ["tools", "Lentille NCC", "Lenses", "Lentilla NCC", {}, ""], antigrav_scooter: ["tools", "Trottinette Anti-Grav.", "Anti-Grav Scooter", "Patinete Anti-Gravedad", { charges: 8 }, ""], rolling_boulder: ["tools", "Monture Rocheuse", "Rolling Boulder", "Montura Rocosa", {}, ""], wavoscope: ["tools", "Vaguoscope", "Oscilloscope", "Olascopio", {}, ""], wrench: ["tools", "Clé à molette", "Adjustable Wrench", "Llave inglesa", {}, ""], alien_can_opener: ["tools", "Décapsuleur Alien", "Alien Bottle Opener", "Abrebotellas Alien", {}, ""], protection_gloves: ["tools", "Gants de protection", "Protective Gloves", "Guantes de protección", {}, ""],
blaster: ["weaponry", "Blaster", "Blaster", "Blaster", { charges: 3 }, ""], grenade: ["weaponry", "Grenade", "Grenade", "Granada", {}, ""], knife: ["weaponry", "Couteau", "Knife", "Cuchillo", {}, ""], machine_gun: ["weaponry", "Sulfateuse", "Old Faithful", "Sulfatosa", { charges: 12 }, ""], missile_launcher: ["weaponry", "Lance-Roquette", "Rocket Launcher", "Lanza-misiles", { charges: 1 }, ""], natamy_riffle: ["weaponry", "Natamy", "Natamy Rifle", "Fusil Natamy", { charges: 3 }, ""], sniper_riffle: ["weaponry", "Lizaro Jungle", "Lizaro Jungle", "Lizaro Jungle", { charges: 1 }, ""],
};
Main.AstroPad.getStorage = function(variable) {
return localStorage['ASTROPAD_' + Main.AstroPad.language + variable];
};
Main.AstroPad.setStorage = function(variable, value) {
localStorage['ASTROPAD_' + Main.AstroPad.language + variable] = value;
};
Main.AstroPad.capitalize = function(str) {
if (str == undefined) {
return "";
}
return str.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};
Main.AstroPad.getRoomId = function() {
return Main.AstroPad.roomNames.indexOf($("#input").attr('d_name'));
};
Main.AstroPad.getHname = function() {
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.me) {
return st1.surname;
}
}
return $('.who').html().trim(); //In case the loop somehow didn't work
};
Main.AstroPad.getMushStatus = function() {
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.skills == null) {
continue;
}
if (!st1.me) {
continue;
}
var $it1 = st1.statuses.iterator();
while ($it1.hasNext()) {
if ($it1.next().img == "mush") {
return true;
}
}
}
return false;
};
Main.AstroPad.canReadPills = function() { //Can read pills effects
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.skills == null) {
continue;
}
if (!st1.me) {
continue;
}
var $it1 = st1.skills.iterator();
while ($it1.hasNext()) {
if (["biologist", "first_aid", "medic", "skilful"].indexOf($it1.next().img) != -1) {
return true;
}
}
}
return false;
};
Main.AstroPad.canReadFood = function() { //Can read fruits and food effects
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.skills == null) {
continue;
}
if (!st1.me) {
continue;
}
var $it1 = st1.skills.iterator();
while ($it1.hasNext()) {
if ($it1.next().img == "cook") {
return true;
}
}
}
return false;
};
Main.AstroPad.canReadFruit = function() { //Can read fruits effects
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.skills == null) {
continue;
}
if (!st1.me) {
continue;
}
var $it1 = st1.skills.iterator();
while ($it1.hasNext()) {
if (["botanic", "skilful"].indexOf($it1.next().img) != -1) {
return true;
}
}
}
return false;
};
Main.AstroPad.isFrugivore = function() { //Is a frugivore (adds +2 to food effects)
var $it0 = Main.heroes.iterator();
while ($it0.hasNext()) {
var st1 = $it0.next();
if (st1.skills == null) {
continue;
}
if (!st1.me) {
continue;
}
var $it1 = st1.skills.iterator();
while ($it1.hasNext()) {
if ($it1.next().img == "frugivore") {
return true;
}
}
}
return false;
};
Main.AstroPad.getData = function() {
var hero = Main.AstroPad.heronames.indexOf(Main.AstroPad.getHname());
var gid = Main.AstroPad.getStorage('gid');
var gkey = Main.AstroPad.getStorage('gkey');
return 'hid=' + hero + '&gid=' + gid + '&gkey=' + gkey + '&tid=0&chk=0';
};
Main.AstroPad.selectTab = function(el) {
if ($(el).attr('data-tab') != undefined) { //Original game tab
$("#astrotab").removeClass("tabon").addClass("taboff");
$("#astrotab_content").hide();
Main.AstroPad.fill("");
return Main.selChat($(el).attr('data-tab'));
}
//Script tab
$("#cdTabsChat li").removeClass("tabon").addClass("taboff");
$("#chatBlock > *").hide();
$(el).removeClass("taboff").addClass("tabon"); //Tab
var scriptTab = $($(el).attr('data-script-tab'));
if (scriptTab.length) {
$(scriptTab).show(); //Content
}
var scriptFunc = $(el).attr('data-script-function');
if (scriptFunc) {
scriptFunc = scriptFunc.split('.');
var func = unsafeWindow;
for (var i = 0; i < scriptFunc.length; i++) {
func = func[scriptFunc[i]];
}
func();
}
};
Main.AstroPad.buildAstrotab = function() {
if ($("#astrotab").length > 0) {
return;
}
//Astrotab
var content = $("<div>").addClass("cdAstroTab").attr("id", "astrotab_content").appendTo($("#chatBlock"));
var tabschat = $("#cdTabsChat");
var tab = $("<li>").addClass("tab taboff").css('margin-right', '3px').appendTo(tabschat);
tab.attr({ id: "astrotab", 'data-script-tab': '#astrotab_content', 'data-script-function': 'Main.AstroPad.getInventory' });
$("<img>").attr("src", "/img/icons/ui/pa_comp.png").appendTo(tab);
Main.AstroPad.fill("");
content.hide();
content.parent().css('height', '500px');
tab.on("mouseover", function() {
Main.showTip($(this)[0], "<div class='tiptop'><div class='tipbottom'><div class='tipbg'><div class='tipcontent'> <h1>AstroPad</h1> <p>" + Main.AstroPad.txt.desc + "</p> </div></div></div></div>");
});
tab.on("mouseout", function() { Main.hideTip(); });
$("#cdTabsChat li").on("click", function() { Main.AstroPad.selectTab(this); });
};
Main.AstroPad.createButton = function(text) {
return $('<div>').addClass('but').html("<div class='butright'><div class='butbg'>" + text + "</div></div>");
}
Main.AstroPad.propertiesToText = function(idetail) {
var attrs = [];
var iname = '';
if (idetail.charges != null) {
attrs.push(idetail.charges + ' ' + Main.AstroPad.txt.charges);
}
if (idetail.broken) {
iname += ' ' + Main.AstroPad.txt.broken;
}
if (idetail.foodState != null) {
switch (idetail.foodState) {
case 'unstable':
iname += ' ' + Main.AstroPad.txt.unstable;
break;
case 'hazardous':
iname += ' ' + Main.AstroPad.txt.hazardous;
break;
case 'decaying':
iname += ' ' + Main.AstroPad.txt.decaying;
break;
}
}
if (idetail.frozen) {
iname += ' ' + Main.AstroPad.txt.frozen;
}
if (idetail.plantThirst != null) {
switch (idetail.plantThirst) {
case 'thirsty':
iname += ' ' + Main.AstroPad.txt.thirsty;
break;
case 'dry':
iname += ' ' + Main.AstroPad.txt.dry;
break;
}
}
if (idetail.plantIll) {
iname += ' ' + Main.AstroPad.txt.diseased;
}
var props = idetail.foodEffects;
if (props.length > 0) {
for (var j = 0; j < props.length; j++) {
var attr = '';
var prop = props[j];
function sign(n) { //1 → '+1'
if (n > 0) {
n = "+" + n;
}
return n;
};
if (prop.chances != undefined && prop.chances && prop.chances != 100) {
attr += prop.chances + "% : ";
}
switch (prop.type) {
case 'pa':
attr += sign(prop.value) + ":pa:";
break;
case 'pm':
attr += sign(prop.value) + ":pm:";
break;
case 'hp':
attr += sign(prop.value) + ":hp:";
break;
case 'moral':
attr += sign(prop.value) + ":moral:";
break;
case 'satisfaction':
attr += sign(prop.value) + ":pa_cook:";
break;
case 'cures':
attr += Main.AstroPad.txt.curesText + " " + prop.value;
break;
case 'causes':
attr += Main.AstroPad.txt.causesText + " " + prop.value;
break;
}
if (prop.delay != undefined && prop.delay) {
attr += ' (' + prop.delay + ' ' + Main.AstroPad.txt.cycles + ')';
}
attrs.push(attr);
}
}
return [iname, attrs.join(', ')];
};
Main.AstroPad.sendData = function(sendCallback) {
var data = Main.AstroPad.getData() + '&data=';
var url = Main.AstroPad.urlAstro + "/addItems";
var conso = '';
if (Main.AstroPad.items.length) {
for (var i = 0; i < Main.AstroPad.items.length; i++) {
var item = Main.AstroPad.items[i];
var iname = item.name;
var idetail = item.properties;
var text = Main.AstroPad.propertiesToText(idetail);
if (item.pushToConso && text[1]) {
conso += item.id + '|' + text[1] + '§';
}
data += encodeURIComponent(item.roomId + '|' + iname + text[0] + '|' + item.id + '|' + item.amount + '|' + text[1] + '|' + item.day + '§');
}
data = data.slice(0, -1); //Remove the trailing §
}
else {
data += Main.AstroPad.getRoomId() + "||empty|0||";
}
data += "&conso=" + encodeURIComponent(conso);
console.log(url + '?' + data);
GM.xmlHttpRequest({
method: 'POST', url: url, data: data, headers: { 'Content-type': 'application/x-www-form-urlencoded' },
onload: function(responseDetails) {
//console.log(responseDetails.responseText);
Main.AstroPad.getInventory();
if (typeof sendCallback == 'function') {
sendCallback();
}
}
});
};
Main.AstroPad.addItem = function(sendCallback) {
var elements = [];
elements.push($('<h3>').css('text-align', 'center').text(Main.AstroPad.txt.itemChoice));
var list = $('<div>').css({ width: '100%', backgroundColor: '#3D5F8D', color: 'white', borderTop: '2px solid navy', borderBottom: '2px solid navy' }); //Categories
var cats = {
misc: ['talkie', Main.AstroPad.txt.itemCatMisc],
tools: ['pa_eng', Main.AstroPad.txt.itemCatTools],
weaponry: ['pa_shoot', Main.AstroPad.txt.itemCatWeaponry],
documents: ['book', Main.AstroPad.txt.itemCatDocuments],
food: ['pa_cook', Main.AstroPad.txt.itemCatFood],
plants: ['pa_garden', Main.AstroPad.txt.itemCatPlants],
health: ['drugs', Main.AstroPad.txt.itemCatHealth],
expedition: ['planet', Main.AstroPad.txt.itemCatExpedition],
alien: ['artefact', Main.AstroPad.txt.itemCatAlien]
};
var div = $('<div>').addClass('what_happened').attr('id', 'astromod-add-item'); //Items (a table for each category)
for (cat in cats) {
//Icon
var img = cats[cat][0];
$('<div>').attr('data-astromod-cat', cat).css({
display: 'inline-block',
borderRight: '2px solid navy',
padding: '5px',
cursor: 'pointer',
backgroundColor: (cat == 'misc' ? '#7D7FAD' : 'transparent') //Misc selected by default
}).hover(function() { //In
$(this).css('background-color', '#7D7FAD');
}, function() { //Out
if (!$(this).hasClass('astromod-cat-selected')) {
$(this).css('background-color', 'transparent');
}
}).html("<img src='http://" + Main.AstroPad.urlMush + "/img/icons/ui/" + img + ".png' />").appendTo(list).on('click', function() {
var c = $(this).attr('data-astromod-cat');
$('#astromod-cat-name').text(cats[c][1]);
$("#astromod-add-item table").hide();
$('#astromod-table-' + c).show();
$('[data-astromod-cat]').css('background-color', 'transparent').removeClass('astromod-cat-selected');
$(this).css('background-color', '#7D7FAD').addClass('astromod-cat-selected');
}).addClass(cat == 'misc' ? 'astromod-cat-selected' : '');
//Items
var table = $('<table>').addClass('table').attr('id', 'astromod-table-' + cat).appendTo(div);
if (cat != 'misc') {
table.hide();
}
var tr = $('<tr>').appendTo(table);
var p = 0; //Odd or even
for (item in Main.AstroPad.allItems) { //Scan all items
if (Main.AstroPad.allItems[item][0] != cat) { //And only choose those of this category
continue;
}
if (p % 2 == 0) { //New line
tr = $('<tr>').appendTo(table);
}
var code = item.replace('camera_installed', 'camera').replace('young_fruit_tree', 'fruit_tree');
if (/blueprint/.test(code)) {
code = 'blueprint';
}
else if (/book/.test(code)) {
code = 'book';
}
//Image
var td = $('<td>').css({
height: '35px',
width: '35px',
padding: 0,
border: '2px solid #1D3F6D'
}).hover(function() { //In
$(this).css('border', '2px solid #4D3F6D');
$(this).next().css('background-color', '#4D3F6D');
}, function() { //Out
$(this).css('border', '2px solid #1D3F6D');
$(this).next().css('background-color', 'transparent');
}).appendTo(tr);
$('<img>').css({ height: '35px', width: '35px', cursor: 'pointer' }).attr({
src: "http://" + Main.AstroPad.urlMush + "/img/icons/items/" + code + ".jpg",
'data-astromod-itemcode': item
}).on('click', function() {
//Add item and go back to AstroMod
var code = $(this).attr('data-astromod-itemcode');
var name = Main.AstroPad.allItems[code][Main.AstroPad.lang];
//Determine whether food effects can be shared via conso
var pushToConso = false;
var type = Main.AstroPad.allItems[code][5];
if (Main.AstroPad.canReadPills() && type == 'pill') {
pushToConso = true;
}
else if (Main.AstroPad.canReadFood() && (type == 'food' || type == 'fruit')) {
pushToConso = true;
}
else if (Main.AstroPad.canReadFruit() && type == 'fruit') {
pushToConso = true;
}
else if (type == 'all') {
pushToConso = true;
}
//Get default properties
var originalProperties = { charges: null, broken: false, foodState: null, frozen: false, plantThirst: null, plantIll: false, foodEffects: [] };
var defaultProperties = Main.AstroPad.allItems[code][4];
for (key in defaultProperties) {
originalProperties[key] = defaultProperties[key];
}
//Get generic code for images
code = code.replace('camera_installed', 'camera').replace('young_fruit_tree', 'fruit_tree');
if (/blueprint/.test(code)) {
code = 'blueprint';
}
else if (/book/.test(code)) {
code = 'book';
}
if (!name) {
name = Main.AstroPad.txt.defaultItem;
}
Main.AstroPad.items.push({
roomId: Main.AstroPad.getRoomId(),
name: name,
id: code,
amount: 1,
properties: { charges: null, broken: false, foodState: null, frozen: false, plantThirst: null, plantIll: false, foodEffects: [] },
originalProperties: originalProperties,
day: 0,
pushToConso: pushToConso
});
Main.AstroPad.buildAstromod(sendCallback);
}).appendTo(td);
//Name
$('<td>').css('padding', '0').text(Main.AstroPad.capitalize(Main.AstroPad.allItems[item][Main.AstroPad.lang])).appendTo(tr);
p += 1;
}
}
$('<span>').attr('id', 'astromod-cat-name').css('margin-left', '20px').text(Main.AstroPad.txt.itemCatMisc).appendTo(list); //Category name
elements.push(list, div);
elements.push(Main.AstroPad.createButton(Main.AstroPad.txt.cancelAstromod).on('click', function() {
Main.AstroPad.buildAstromod(sendCallback);
}));
Main.AstroPad.fill(elements);
};
Main.AstroPad.changeItemProperties = function(id, sendCallback) {
var item = Main.AstroPad.items[id];
var attrs = item.properties;
var form = $('<form>').css('color', 'black !important').attr('data-astromod-item', id);
$('<img>').css({ width: '20px', height: '20px', marginLeft: '5px' }).attr('src', '/img/icons/items/' + item.id + '.jpg').appendTo(
$('<h3>').text(Main.AstroPad.txt.propertyTitle + " " + item.name).css({ textAlign: 'center', margin: '10px 0' }).appendTo(form)
);
// PLANT PROPERTIES //
var plantField = $('<fieldset>').appendTo(form);
//Thirsty
switch (attrs.plantThirst) {
case 'thirsty':
var defaultThirst = [false, 'selected', false];
break;
case 'dry':
var defaultThirst = [false, false, 'selected'];
break;
default:
var defaultThirst = ['selected', false, false];
break;
}
$('<label>').text(Main.AstroPad.txt.propertyPlant + " ").attr('for', 'astromod-plant-thirst').appendTo(plantField);
var plantSelect = $('<select>').attr('name', 'astromod-plant-thirst').css('color', 'black').appendTo(plantField);
$('<option>').text("—").attr({ selected: defaultThirst[0], value: null }).appendTo(plantSelect);
$('<option>').text(Main.AstroPad.txt.thirsty).attr({ selected: defaultThirst[1], value: 'thirsty' }).appendTo(plantSelect);
$('<option>').text(Main.AstroPad.txt.dry).attr({ selected: defaultThirst[2], value: 'dry' }).appendTo(plantSelect);
//Ill
$('<input>').attr({ type: 'checkbox', checked: attrs.plantIll, name: 'astromod-plant-ill' }).css('margin-left', '20px').appendTo(plantField);
$('<label>').text(Main.AstroPad.txt.diseased).attr('for', 'astromod-plant-ill').appendTo(plantField);
var electricField = $('<fieldset>').appendTo(form);
//Charges
$('<input>').attr({ type: 'checkbox', checked: (attrs.charges != null), name: 'astromod-hascharges' }).css('color', 'black').appendTo(electricField);
$('<label>').text(Main.AstroPad.capitalize(Main.AstroPad.txt.charges) + " : ").attr('for', 'astromod-charges').appendTo(electricField);
$('<input>').attr({ type: 'number', min: 0, max: 20, value: attrs.charges, name: 'astromod-charges' }).css({ color: 'black', width: '4em' }).appendTo(electricField);
//Broken
$('<input>').attr({ type: 'checkbox', checked: attrs.broken, name: 'astromod-broken' }).css('margin-left', '20px').appendTo(electricField);
$('<label>').text(Main.AstroPad.txt.broken).attr('for', 'astromod-broken').appendTo(electricField);
// FOOD PROPERTIES //
var foodField = $('<fieldset>').appendTo(form);
//Food state
switch (attrs.foodState) {
case 'unstable':
var rottenState = [false, 'selected', false, false];
break;
case 'hazardous':
var rottenState = [false, false, 'selected', false];
break;
case 'decaying':
var rottenState = [false, false, false, 'selected'];
break;
default:
var rottenState = ['selected', false, false, false];
break;
}
$('<label>').text(Main.AstroPad.txt.propertyFoodState + " ").attr('for', 'astromod-food-state').appendTo(foodField);
var foodSelect = $('<select>').attr('name', 'astromod-food-state').css('color', 'black').appendTo(foodField);
$('<option>').text("—").attr({ selected: rottenState[0], value: null }).appendTo(foodSelect);
$('<option>').text(Main.AstroPad.txt.unstable).attr({ selected: rottenState[1], value: 'unstable' }).appendTo(foodSelect);
$('<option>').text(Main.AstroPad.txt.hazardous).attr({ selected: rottenState[2], value: 'hazardous' }).appendTo(foodSelect);
$('<option>').text(Main.AstroPad.txt.decaying).attr({ selected: rottenState[3], value: 'decaying' }).appendTo(foodSelect);
//Frozen
$('<input>').attr({ type: 'checkbox', checked: attrs.frozen, name: 'astromod-food-frozen' }).css('margin-left', '20px').appendTo(foodField);
$('<label>').text(Main.AstroPad.txt.frozen).attr('for', 'astromod-food-frozen').appendTo(foodField);
// FOOD EFFECTS //
var effectsField = $('<fieldset>').attr('id', 'astromod-effects').appendTo(form);
$('<h3>').text(Main.AstroPad.txt.foodEffects).appendTo(effectsField);
var effectsTable = $('<table>').addClass('table').appendTo($('<div>').addClass('what_happened').appendTo(effectsField));
function generateDiseasesSelect(currentDisease) {
var diseaseInList = false;
var select = $('<select>').attr('name', 'astromod-effect-value-' + i).css('color', 'black');
var phyGroup = $('<optgroup>').attr('label', Main.AstroPad.txt.propertyPhysical).appendTo(select);
for (var j = 0; j < Main.AstroPad.physicalDiseases.length; j++) {
var disease = Main.AstroPad.physicalDiseases[j];
if (disease == currentDisease) {
$('<option>').text(disease).attr({ value: disease, selected: true }).appendTo(phyGroup);
diseaseInList = true;
}
else {
$('<option>').text(disease).attr({ value: disease }).appendTo(phyGroup);
}
}
var psyGroup = $('<optgroup>').attr('label', Main.AstroPad.txt.propertyPsychological).appendTo(select);
for (var j = 0; j < Main.AstroPad.psychologicalDiseases.length; j++) {
var disease = Main.AstroPad.psychologicalDiseases[j];
if (disease == currentDisease) {
$('<option>').text(disease).attr({ value: disease, selected: true }).appendTo(psyGroup);
diseaseInList = true;
}
else {
$('<option>').text(disease).attr({ value: disease }).appendTo(psyGroup);
}
}
if (currentDisease && !diseaseInList) { //If unknown disease, add it
$('<option>').text(currentDisease).attr({ value: currentDisease, selected: true }).insertBefore(phyGroup);
}
return select;
}
function generateEffectLine(effect) {
var tr = $('<tr>').attr({ class: 'astromod-effect', 'data-astromod-effect': effect.type, 'data-astromod-effect-number': i }).appendTo(effectsTable);
switch (effect.type) {
case 'pa':
var td = $('<td>');
$('<input>').attr({ type: 'number', min: -20, max: 20, value: effect.value, name: 'astromod-effect-value-' + i }).css({ color: 'black', width: '4em' }).appendTo(td);
$('<img>').attr('src', '/img/icons/ui/pa_slot1.png').appendTo(td);
td.appendTo(tr);
break;
case 'pm':
var td = $('<td>');
$('<input>').attr({ type: 'number', min: -20, max: 20, value: effect.value, name: 'astromod-effect-value-' + i }).css({ color: 'black', width: '4em' }).appendTo(td);
$('<img>').attr('src', '/img/icons/ui/pa_slot2.png').appendTo(td);
td.appendTo(tr);
break;
case 'hp':
var td = $('<td>');
$('<input>').attr({ type: 'number', min: -20, max: 20, value: effect.value, name: 'astromod-effect-value-' + i }).css({ color: 'black', width: '4em' }).appendTo(td);
$('<img>').attr('src', '/img/icons/ui/lp.png').appendTo(td);
td.appendTo(tr);
break;
case 'moral':
var td = $('<td>');
$('<input>').attr({ type: 'number', min: -20, max: 20, value: effect.value, name: 'astromod-effect-value-' + i }).css({ color: 'black', width: '4em' }).appendTo(td);
$('<img>').attr('src', '/img/icons/ui/moral.png').appendTo(td);
td.appendTo(tr);
break;
case 'satisfaction':