Skip to main content

Hoardomatic Code: Enchantment Class

Enchantments are structurally very similar to Embellishments. The big difference is how costs are accounted for by the Item containing them.

Enchantment


String Enchantment_name: The name of the enchantment, usually just the name of a spell, though it may include a degree (Accuracy 3) or notation about which version of an enchantment the item has (Bravery (Cast only)).
Double cf: The embellishment's CF value. Not actually used, but it's there because I started enchantments by copying the embellishment class.
Double flat_cost: The base cost of the enchantment.
Double wt_mod: Weight adjustment, if any, which spells generally don't have.
String motif_option: Not used.
String ench_code: A code similar to the embellishment codes, indicating what kind of item the enchantment can be on. Most are generally applicable, but a few are limited to weapons or armor.

This class works very much like the Embellishments class: it takes a node provided to it and populates the enchantment's properties.

package hoardomatic;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Enchantment {
   
    private String Enchantment_name;
    private Double cf;
    private Double flat_cost;
    private Double wt_mod;
    private String motif_option;
    private String ench_code;

    public Enchantment() {

        Enchantment_name = "";
        cf = 0.0;
        flat_cost = 0.0;
        wt_mod = 1.0;
        motif_option = "";
        ench_code = "";
    }
   
    public Enchantment(Node node) {
        flat_cost = 0.0;

        NodeList tempNodes = node.getChildNodes();
        for (int j = 0; j < tempNodes.getLength(); j++) {
            Node subnode = tempNodes.item(j);

            if (subnode.getNodeType() == Node.ELEMENT_NODE) {
                Element element = (Element) subnode;
               
                if (element.getNodeName().contentEquals("Enchantment")) {
                    Enchantment_name = element.getTextContent();
                }

                if (element.getNodeName().contentEquals("CF")) {
                    cf =Double.parseDouble(element.getTextContent());
                }

                if (element.getNodeName().contentEquals("Cost")) {
                    flat_cost =Double.parseDouble(element.getTextContent());
                }

                if (element.getNodeName().contentEquals("wtmod")) {
                    wt_mod = Double.parseDouble(element.getTextContent());
                }

                if (element.getNodeName().contentEquals("ench_code")) {
                    ench_code = element.getTextContent();
                }

                if (element.getNodeName().contentEquals("Type")) {
                    ench_code = element.getTextContent();
                }

            }

        }

    }

   
   
    public Enchantment(String the_name, Double the_cf, Double the_wt_mod) {

        Enchantment_name = the_name;
        cf = the_cf;
        wt_mod = the_wt_mod;
    }
   
    public void setCost(Double new_cost){
        flat_cost = new_cost;
    }
   
    public Double getCost(){
        return flat_cost;
    }
   
    public void setCF(Double new_cf){
        cf = new_cf;
    }
   
   
    public String getEnchantmentName(){
        return Enchantment_name;
    }
   
    public String getMotifOption(){
        return motif_option;
    }
   
    public Double getCf(){
        return cf;
    }

    public Double getWtMod(){
        return wt_mod;
    }
   
    public String getenchCode(){
        return ench_code;
    }


}

Comments

Popular posts from this blog

Ferrous Metal Food Fighting Guy!

(This is something I wrote up some years back. I'm putting it here so I can find it more easily when I want to. Though it's rather silly, it's also where I came up with the idea of high-quality materials which don't provide a bonus to the craftsman's skill, but do add to the margin of success, a mechanism which later appeared in the crafting rules in GURPS Low-Tech Companion 3 .) One of the things not to be found in GURPS 4e is extensive rules for competitive cooking. If two cooks of steely resolve rise up to face one another across a cooking coliseum, the GM can only fall back on hand-waving and contests of skill. This article fills that much-needed gap. GURPS chefs can now stage furious contests wherein they construct fanciful dishes, the more elaborate the better, and prove whose cooking rules the day. To the kitchen! Procedure These rules provide guidance for attempting to cook complex dishes and comparing their quality when the cooking is done. A che

Car Wars Minis, Third Batch

Still having a go at these, trying out some new ideas. The short version is that having the right tools and materials is still key, but I've got a way to go with some other stuff. I think this one looks better in person than as a picture. A couple of shades of blue here with a blue wash and drybrushed metallic blue on some components. Oh, and purple spikes. I didn't even try to figure out something clever to do with the windshield. I'm finding that it's hard to make yellow work, but this one wasn't too bad. I initially tried masking the area for the blue stripe with tape, but it pulled off the paint instead. Had to do a swipe with a broad brush, which isn't great but worked better than I expected. Another one that looks better in person than on film. Tried to do a few different shades of green, which wasn't entirely successful. Probably my best out of this batch. I credit the red wash, which ended up being kind of glossy and goes well with the copper accents

Charcuterie Bard

A few days ago, I dropped this random gag:   I shall make a character for an RPG who has powers related to artistic creativity, but instead of music and song, they come from arranging cheeses and cured meats. A charcuterie bard. — Turhan's Bey Company (@turhansbeycmpny) December 21, 2021   But then I remembered that there's absolutely precedent for food-based magic:  So, then, obviously we can have food-based bards in GURPS, right? The best approach I see is modifying the Enthrallment skills (p. B191). However, rather than requiring Public Speaking at 12+ as a prerequisite, a charcuterie bard requires Cooking and Professional Skill (Food Stylist) at 12+; see Ferrous Metal Food Fighting Guy for a bit on the latter. The skills are used by preparing and feeding an audience with tasty, tasty foods. The elements of food in question cost a minimum of 1% of COL per target, though higher quality ingredients provide a bonus (use costs and reaction bonuses for styling, GURPS Low-Tech