mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-27 13:13:10 -04:00
* Code compiles - execution NOT tested * updating gitignore * Removed intellij settings files * Removed more intellij files * Added exclusion for JDK classes. * Fixed purchasing script for vendors that have listed coin types. * Updated script to not kick off until the entire preload is complete. * adds static name entry for Solo movie poster and tcg9 vendor entry * clean up empty and orphaned object templates * adds placeholder black market (static) spawns * corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors * Updated gitignore and removed intellij project files * Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src * Fixed appearance and template for terminal (#2) * Fixed appearance and template for terminal (#3) * Fixed appearance and template for terminal (#4) * Deleted another faulty/orphaned object template * Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges. * Fixed some unneeded java 11 changes
63 lines
1.9 KiB
Java
Executable File
63 lines
1.9 KiB
Java
Executable File
package script.item.comestible;
|
|
|
|
import script.attrib_mod;
|
|
import script.library.consumable;
|
|
import script.library.utils;
|
|
import script.obj_id;
|
|
|
|
public class foraged extends script.item.comestible.comestible
|
|
{
|
|
public foraged()
|
|
{
|
|
}
|
|
public static final String FORAGED_DATA = "datatables/foraging/forage_global.iff";
|
|
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
|
|
{
|
|
attrib_mod[] am = consumable.getForagedFoodMods(self);
|
|
int n = utils.getValidAttributeIndex(names);
|
|
if (n == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
names[n] = EXAM_ATTRIB_MOD;
|
|
if ((am == null) || (am.length == 0))
|
|
{
|
|
attribs[n] = EXAM_NONE;
|
|
n++;
|
|
if (n > names.length)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int numMods = am.length;
|
|
attribs[n] = "" + numMods;
|
|
n++;
|
|
if (n > names.length)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
for (attrib_mod attrib_mod : am) {
|
|
int attrib = attrib_mod.getAttribute();
|
|
int val = attrib_mod.getValue();
|
|
int newVal = Integer.MIN_VALUE;
|
|
int duration = (int) (attrib_mod.getDuration());
|
|
String sVal = "";
|
|
if (newVal > 0) {
|
|
sVal = "+" + newVal;
|
|
} else if (newVal < 0) {
|
|
sVal = "" + newVal;
|
|
}
|
|
names[n] = toLower(consumable.STAT_NAME[attrib]);
|
|
attribs[n] = sVal + "%, " + duration + "s";
|
|
n++;
|
|
if (n > names.length) {
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|