Skip to main content

Hoardomatic Code: Embellishment Class

This represents an individual decorative or functional embellishment on an item.

Embellishment


String embellishment_name: Name of the embellishment (for example, "Fine material" or "Tassels").
Double cf: The embellishment's CF value.
Double wt_mod: Weight adjustment, if any. This defaults to 1 and is expressed as a decimal multiplier to the base item's weight. For example, 0.9 for an embellishment which reduces the weight of the item by 10%.
String motif_option: Some options don't lead to item having a particular decorative motif (for example, improved materials). Some do (for example, relief carving). Some could go either way (for example, painting; an item could simply be painted, say, entirely green, or have figures painted on it in green). This defaults to "N".
String emb_code: A single string corresponding to the range of attributes which items may have.

The constructor I'm using takes a node (from Embelishments.xml) handed to it by the calling class. It goes through the node's elements and extracts various bits of data, putting them into the appropriate variables.


package hoardomatic;

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

public class Embellishment {
   
    private String embellishment_name;
    private Double cf;
    private Double flat_cost;
    private Double wt_mod;
    private String motif_option;
    private String emb_code;

    public Embellishment() {

        embellishment_name = "";
        cf = 0.0;
        flat_cost = 0.0;
        wt_mod = 1.0;
        motif_option = "";
        emb_code = "";
    }
   
    public Embellishment(Node node) {

        motif_option = "";
        wt_mod = 1.0;
        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("Embellishment")) {
                    embellishment_name = element.getTextContent();
                }

                if (element.getNodeName().contentEquals("motif")) {
                    motif_option = 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("emb_code")) {
                    emb_code = element.getTextContent();
                }

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

            }

        }

    }

   
   
    public Embellishment(String the_name, Double the_cf, Double the_wt_mod) {
        // TODO Auto-generated constructor stub
        embellishment_name = the_name;
        cf = the_cf;
        wt_mod = the_wt_mod;
    }

    public void setWtMod(Double new_wt_mod){
        flat_cost = new_wt_mod;
    }
   
    public void setCost(Double new_cost){
        flat_cost = new_cost;
    }
   
    public void setCF(Double new_cf){
        cf = new_cf;
    }
   
   
    public String getEmbellishmentName(){
        return embellishment_name;
    }
   
    public void setEmbellishmentName(String new_name){
        embellishment_name = new_name;
    }
   
    public String getMotifOption(){
        return motif_option;
    }
   
    public Double getCf(){
        return cf;
    }

    public Double getWtMod(){
        return wt_mod;
    }
   
    public String getEmbCode(){
        return emb_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