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

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

Car Wars Minis, Second Batch

They say it's a poor craftsman who blames their tools. Is it a poor craftsman who gives them credit when things work out? If so, I am that craftsman. After my first round of not-great miniature painting, I ran off some more CW minis and tried more painting, this time digging up my well-hidden actually-for-minis paints (as opposed to the standard craft store acrylics I used the first time around), which I had more than I thought I did, and limited myself to my tiniest brushes. I also watched a few more YouTube videos about painting minis just to get a better feel for what it looked like when people did that. How did it come out? Still not great, but better. The first of batch #2 and by a considerable margin the worst. Involved some ill-advised dry brushing and the metallic paint I used for the weapons and I didn't thin the metallic paint I used on the weapons and side windows, losing all the detail in the process. This one...is actually OK. The thinned blue and purple paints gi

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