Status:
Prototype code tested, working as intended.
Further development will be halted until i receive a answer from Fenoxo, so i don't break the game's balance...
--------------------------------------------------------------
Hello, i have been playing the game for a while now, and one of the things that i noticed is a lack of Customizable equipment (Hence why i'm creating this thread...) So i've decided to try and do something about it...
I have already figured out how to go about it, but i want to be sure that what i'm doing is viable, and also i'm not very creative so if anyone has ideas for mods description and names i appreciate it...
Anyway, what i want to confirm is if it's ok to use the "hasRandomProperties" (what i'm gona use to make equipments modable), if my code could be improved and to see if people have interest in customizing their equipment.
So if you know the game's code, please take a look here and tell me if you have any suggestion:
Global.as flag:
The code above creates the item "Armor Shield MKI", that adds 10 shield points to the currently equipped armor when the item is used and change its name and tooltip to differentiate it from it's base (Just a prototype).
Edit:
If the item has already modded, the effects of the previous mod would be lost, so you can only 'add' one mod per equipment.
So , if you are interested and have any suggestions for mods (can be for any equippable item [Shields, Weapon, Accessories ..]), or for the code, please leave it here.
Attached are some images of the prototype test, working as intended so far... (i've 'hijacked' Crazy Carl's first shop slot to add the item to the game...)
Prototype code tested, working as intended.
Further development will be halted until i receive a answer from Fenoxo, so i don't break the game's balance...
--------------------------------------------------------------
Hello, i have been playing the game for a while now, and one of the things that i noticed is a lack of Customizable equipment (Hence why i'm creating this thread...) So i've decided to try and do something about it...
I have already figured out how to go about it, but i want to be sure that what i'm doing is viable, and also i'm not very creative so if anyone has ideas for mods description and names i appreciate it...
Anyway, what i want to confirm is if it's ok to use the "hasRandomProperties" (what i'm gona use to make equipments modable), if my code could be improved and to see if people have interest in customizing their equipment.
So if you know the game's code, please take a look here and tell me if you have any suggestion:
Code:
package classes.Items.Mods
{
import classes.Engine.Interfaces.*;
import classes.Engine.Utility.rand;
import classes.ItemSlotClass;
import classes.GLOBAL;
import classes.Creature;
import classes.Items.Miscellaneous.EmptySlot;
import classes.kGAMECLASS;
import classes.Characters.PlayerCharacter;
import classes.GameData.TooltipManager;
import classes.StringUtil;
public class ArmorShield01 extends ItemSlotClass
{
public function ArmorShield01()
{
super();
_latestVersion = 0;
quantity = Number(Number(1));
stackSize = 10;
type = GLOBAL.PILL;
shortName = "Mod A.S.MKI";
longName = "Mod Armor Shield MKI";
TooltipManager.addFullName(shortName, StringUtil.toTitleCase(longName));
description = "A kit that will modify your armor to make it passively generate some Shield.";
tooltip = "A small kit containing adaptable nanomachines that will modify your current armor to make it passively generate 10 more Shield Points.\n\n<b>WARNING: Only one mod per Equipment piece, last mod will be Overwriten.</b>";
TooltipManager.addTooltip(shortName, tooltip);
attackVerb = "";
basePrice = Number(Number(5000));
version = int(int(_latestVersion));
}
override public function useFunction(target:Creature, usingCreature:Creature = null) : Boolean
{
kGAMECLASS.clearOutput();
//Item used by someone other than player
if(!(target is PlayerCharacter)) {
output("Nothing Changed.");
//return kit to player?
return false;
}
//player is not currently wearing armor
if (target.armor is EmptySlot) {
output("You open the kit then then remember you are not wearing any armor to use it on!\n\nYou close the kit and put it away.");
//return kit to player
quantity++;
return false;
}
//Message to the player
output("Opening the kit, you throw the nanobots into your armor.\nAlmost immediately you start felling tingles all over the parts of your body covered in it.");
//See if this is the first time the item is modified
if(target.armor.hasFlag(GLOBAL.ITEM_FLAG_MODDED)) {
//Message to the player informing of changes (probably put it on the clearer function to give more details)
output("\n\nYou can feel the effects of the previous batch of nanobots fading...");
//Remove current tooltip
TooltipManager.removeFullName(target.armor.shortName + StringUtil.toTitleCase(target.armor.longName));
TooltipManager.removeTooltip(target.armor.shortName + target.armor.tooltip);
//TODO: Call clearer function before proceding
//Debug, delete or comment next line before publishing
output("\n\nFlag Detected, this part is working!\n\n");
}
else {
//Mark item as modded
target.armor.addFlag(GLOBAL.ITEM_FLAG_MODDED);
//Mark item to be saved in file
target.armor.hasRandomProperties = true;
//Debug, delete or comment next line before publishing
output("\n\nFlag not Detected, this part is working!\n\n");
}
//Message to the player informing of changes
output("\n\nYou can see the slight glow of your shield intensify!");
//Modify armor shield stat
target.armor.shields = target.armor.shields + 10;
//Modify tooltip
target.armor.tooltip = target.armor.tooltip + "\n\nModded with Armor Shield MKI.";
//Modify name
target.armor.shortName = "S. " + target.armor.shortName;
target.armor.longName = "Shielded " + target.armor.longName;
//Recreate tooltip
TooltipManager.addFullName(target.armor.shortName, StringUtil.toTitleCase(target.armor.longName));
TooltipManager.addTooltip(target.armor.shortName, target.armor.tooltip);
//pass time
kGAMECLASS.processTime(5 + rand(3));
return false;
}
}
}
Global.as flag:
Code:
public static const ITEM_FLAG_MODDED:int = 36; // Marks the item as modified.
The code above creates the item "Armor Shield MKI", that adds 10 shield points to the currently equipped armor when the item is used and change its name and tooltip to differentiate it from it's base (Just a prototype).
Edit:
If the item has already modded, the effects of the previous mod would be lost, so you can only 'add' one mod per equipment.
So , if you are interested and have any suggestions for mods (can be for any equippable item [Shields, Weapon, Accessories ..]), or for the code, please leave it here.
Attached are some images of the prototype test, working as intended so far... (i've 'hijacked' Crazy Carl's first shop slot to add the item to the game...)
Attachments
Last edited: