Character Info Toolbox

The effects brick in CHIT isn't displaying the new "Toxic Vengeance" effect properly. At present I have 223 turns of the effect and CHIT is displaying the effect as:

Code:
Mus +0, 
Myst -1, 
Mox +0, 
Stench Dmg +0, 
Spell Dmg +0

While clicking on the effect to get the KoL description yields:

Code:
Muscle -223
Mysticality -223
Moxie -223
+669 Stench Damage
Spell Damage +669%

Current, unmodified, stats are: Mus: 139, Mys: 214, Mox: 137
Current, modified by the effect, are: Mus: 1, Mys: 1, Mox: 1

This is with KoLmafia r15691.
 
Last edited:
That's a mafia issue, not a ChIT issue. The problem is that mafia doesn't know the effect scales according to duration and ChIT simply repeats mafia knowledge of an effect. If mafia fixes that, then you'll see what you expect.
 
Mafia has known the effect scales to duration since r15677 :

Effect Toxic Vengeance Muscle: [-T], Mysticality: [-T], Moxie: [-T], Stench Damage: [3*T], Spell Damage Percent: [3*T]

I think it works for me, though I must admit I've only checked using modtrace and the modifiers in Mafia. Odd issue.
 
Darzil is correct. Modtrace reports correct values for the affected stats and correctly displays the modified mus, mys, and mox on the character pane in the GUI.
 
Actually, it is a mafia issue. string_modifier() isn't correctly handling evaluation when it scales to duration. Will investigate.
 
Actually, it is a mafia issue. string_modifier() isn't correctly handling evaluation when it scales to duration. Will investigate.

That's actually really funny.
> ash string_modifier($effect[toxic vengeance], "Evaluated Modifiers")

Returned: Muscle: 0, Mysticality: -1, Moxie: 0, Stench Damage: 0, Spell Damage Percent: 0

Huh.
 
Having used kolproxy in the past, there is a single feature of kolproxy's character pane tweaks that chit is missing that is a major area of sadness for me. You can see it on this page. Basically, having your current gear show up on the character pane. I really loved this, and it's the only thing I direly miss about kolproxy when using mafia.

Would it be feasible to add an optional brick for chit that does this? Bonus points if you can click a slot of gear and have a picker show up with your favorited items that can go in that slot, ala the familiar picker, but idk how complicated that is.

Aside from that I generally prefer chit, it's awesome how customizable it is and all the nice little things it has! :) ESPECIALLY the florist friar pane, turned that from a worthless iotm to one of my favorites! I wish they had something like that in the base game, I really think Jick wouldn't hate it as much if they did something like that...

TBH it's possible chit does have a feature like this and I just missed it, with all the stuff chit does have, so if that's the case, my bad!
 
Would it be feasible to add an optional brick for chit that does this? Bonus points if you can click a slot of gear and have a picker show up with your favorited items that can go in that slot, ala the familiar picker, but idk how complicated that is.

Not going to do that because I don't need it and it would not be easy. However, if someone else wants to write up that brick, I'd be pretty happy to add it into ChIT. That wouldn't be the first time someone has collaborated on ChIT.


TBH it's possible chit does have a feature like this and I just missed it, with all the stuff chit does have, so if that's the case, my bad!

I don't know if you noticed, but ChIT, does have a related feature. If you click on your character's portrait you can switch outfits or equip quest stuff.


Aside from that I generally prefer chit, it's awesome how customizable it is and all the nice little things it has! :) ESPECIALLY the florist friar pane, turned that from a worthless iotm to one of my favorites! I wish they had something like that in the base game, I really think Jick wouldn't hate it as much if they did something like that...!

kolproxy copied all of ChIT's other features, so I'm kinda surprised to hear that they didn't bother to copy the florist brick also. (Just to be clear, this script existed long before its features were incorporated into kolproxy.) I'm glad you like it best!
 
Last edited:
Hmm you know what, I will look in to implementing it myself! We'll see how that goes.

Also yeah, the outfit switcher is definitely nice and makes it nearly entirely unnecessary, but yeah... I just like seeing what I have on.
 
Code:
void bakeGear() {
  buffer result;
  
  result.append('<table id="chit_gear" class="chit_brick nospace"><tbody>');
  result.append('<tr><th class="label" colspan="9"><a class="visit" target="mainpane" href="./inventory.php?which=2">Gear</a></th></tr>');
  
  result.append('<tr>');
  foreach s in $slots[ hat, back, weapon, off-hand, shirt, pants, acc1, acc2, acc3 ]
  {
    result.append('<td>');
    item equipped = equipped_item(s);
    if(equipped != $item[none])
    {
      result.append('<img class="chit_gearicon hand" src="/images/itemimages/' + equipped.image + '" onclick="descitem(' + equipped.descid + ',0,event)">');
    }
    else
    {
      result.append('<img class="chit_gearicon" src="/images/itemimages/blank.gif">');
    }
    
    result.append('</td>');
  }
  result.append('</tr>');
  result.append('</tbody></table>');
  
  chitBricks["gear"] = result.to_string();
}

Code:
table.chit_brick img.chit_gearicon {
  border:1px solid #D0D0D0;
  padding:0px;
}

That and adding the case to call bakeGear is what I've done so far. Haven't added the option for picking favorites that fit in that slot yet, which is obviously where the bulk of the work is, but it at least displays all the gear you have equipped!

I'd really appreciate feedback if you see anything obvious I'm doing inefficiently or missing any important steps for general flexibility, but this has been fun and not too bad!

Oh, and I need to figure out an icon for the gear brick, but I am not an art so idk what do.
 
Last edited:
Code:
void pickerGear(slot s) {
	buffer picker;
	picker.pickerStart("gear" + s, "Change " + s);
	
	picker.addLoader("Changing " + s + "...");
  
  boolean any_options = false;
  
  void add_gear_option(item it, string prefix)
  {
    any_options = true;
  
    string command_link = '<a href="' + (it != $item[none] ? sideCommand("equip " + s + " " + it) : sideCommand("unequip " + s)) + '">';
    
    picker.append('<tr class="pickitem"><td class="icon">');
    picker.append(command_link);
    picker.append('<img src="/images/itemimages/');
    if(it != $item[none])
    {
      picker.append(it.image);
    }
    else
    {
      picker.append(equipped_item(s).image);
    }
    picker.append('" /></a></td><td>');
    picker.append(command_link);
    if(it != $item[none])
    {
      picker.append(prefix);
      picker.append(it);
    }
    else
    {
      picker.append("Unequip ");
      picker.append(equipped_item(s));
    }
    picker.append('</td></tr>');
  }
  
  void add_gear_option(item it)
  {
    add_gear_option(it, "");
  }
  
  if(equipped_item(s) != $item[none])
    add_gear_option($item[none]);
  
  item real_item(string name)
  {
    switch(name)
    {
      case "smiths": switch(my_class())
                     {
                      case $class[seal clubber]: return $item[meat tenderizer is murder];
                      case $class[turtle tamer]: return $item[ouija board, ouija board];
                      case $class[pastamancer]: return $item[hand that rocks the ladle];
                      case $class[sauceror]: return $item[saucepanic];
                      case $class[disco bandit]: return $item[frankly mr. shank];
                      case $class[accordion thief]: return $item[shakespears sisters accordion];
                      default: return $item[none];
                     }
    }
    
    return to_item(name);
  }
  
  foreach i,fav in split_string(vars["chit.favgear"], ",")
  {
    item it = real_item(fav);
    if(it != $item[none] && (it.to_slot() == s || (s == $slot[off-hand] && have_skill($skill[double-fisted skull smashing]))) && equipped_item(s) != it)
    {
      if(available_amount(it) > 0)
      {
        add_gear_option(it);
      }
      else if(creatable_amount(it) > 0)
      {
        add_gear_option(it, "CREATE ");
      }
    }
  }
	
  if(!any_options)
  {
    picker.addSadFace("You have no favorited gear available for this slot. Poor you :(");
  }
  
	picker.append('</table></div>');
	chitPickers["gear" + s] = picker;
}


void bakeGear() {
  buffer result;
  
  result.append('<table id="chit_gear" class="chit_brick nospace"><tbody>');
  result.append('<tr><th class="label" colspan="9"><a class="visit" target="mainpane" href="./inventory.php?which=2">Gear</a></th></tr>');
  
  result.append('<tr>');
  foreach s in $slots[ hat, back, weapon, off-hand, shirt, pants, acc1, acc2, acc3 ]
  {
    item equipped = equipped_item(s);
    result.append('<td><a class="chit_launcher" rel="chit_pickergear');
    result.append(s);
    result.append('" href="#"><img class="chit_gearicon hand" src="/images/itemimages/');
    if(equipped != $item[none])
    {
      result.append(equipped.image);
    }
    else
    {
      result.append('blank.gif');
    }
    result.append('" title="');
    result.append(s);
    result.append(': ');
    result.append(equipped);
    result.append('"></a></td>');
    pickerGear(s);
  }
  result.append('</tr>');
  result.append('</tbody></table>');
  
  chitBricks["gear"] = result.to_string();
}

Much further along version. Sadly I can't work out a way to get a list of favorited items, so I've settled for using a zlib variable to hold a list of them (for now anyway).

Here's what I'm using as the default of this var for now, feel free to change it as you see fit:

Code:
setvar("chit.favgear","droll monocle, stinky cheese eye, Hand in Glove, Half a Purse,A Light that Never Goes Out,smiths,hobo code binder, buddy bjorn, The Crown of Ed the Undying,crumpled felt fedora,Hairpiece on Fire, Pantsgiving, Vicar's Tutu, Astral Shirt, duct tape shirt, Stephen's lab coat");

Still needs the css tidbit in the post above.
 
I didn't comb over your code in detail, but I tried it out and it worked except for the width of the displayed table so I reformatted that slightly and committed it.

Add "gear" to the layout for ceiling, walls or floor to see this brick there. Feel free to post future updates for any part of this you want to improve. (I'll play around with it, so I might decide to make a change also.) Thanks for your contribution.

Cheerio!
 
Cool! I've made another tweak, re-adding the popup item descriptions, now when you click the icon in the picker (since those were lost when I switched to the picker), as well as some minor refactoring.

Code:
void pickerGear(slot s) {
	buffer picker;
	picker.pickerStart("gear" + s, "Change " + s);
	
	picker.addLoader("Changing " + s + "...");
  
  boolean any_options = false;
  
  void add_gear_option(item it, string prefix)
  {
    any_options = true;
    
    picker.append('<tr class="pickitem"><td class="icon"><img src="/images/itemimages/');
    picker.append(it != $item[none] ? it.image : equipped_item(s).image);
    picker.append('" class="hand" onclick="descitem(');
    picker.append(it != $item[none] ? it.descid : equipped_item(s).descid);
    picker.append(',0,event)" /></td><td><a href="');
    picker.append(it != $item[none] ? sideCommand("equip " + s + " " + it) : sideCommand("unequip " + s));
    picker.append('">');
    picker.append(prefix);
    picker.append(it != $item[none] ? it : equipped_item(s));
    picker.append('</a></td></tr>');
  }
  
  void add_gear_option(item it)
  {
    add_gear_option(it, "");
  }
  
  if(equipped_item(s) != $item[none])
    add_gear_option($item[none], "Unequip ");
  
  item real_item(string name)
  {
    switch(name)
    {
      case "smiths": switch(my_class())
                     {
                      case $class[seal clubber]: return $item[meat tenderizer is murder];
                      case $class[turtle tamer]: return $item[ouija board, ouija board];
                      case $class[pastamancer]: return $item[hand that rocks the ladle];
                      case $class[sauceror]: return $item[saucepanic];
                      case $class[disco bandit]: return $item[frankly mr. shank];
                      case $class[accordion thief]: return $item[Shakespeare's Sister's Accordion];
                      default: return $item[none];
                     }
    }
    
    return to_item(name);
  }
  
  foreach i,fav in split_string(vars["chit.favgear"], ",")
  {
    item it = real_item(fav);
    if(it != $item[none] && (it.to_slot() == s || (s == $slot[off-hand] && have_skill($skill[double-fisted skull smashing]))) && equipped_item(s) != it)
    {
      if(available_amount(it) > 0)
      {
        add_gear_option(it);
      }
      else if(creatable_amount(it) > 0)
      {
        add_gear_option(it, "CREATE ");
      }
    }
  }
	
  if(!any_options)
  {
    picker.addSadFace("You have no favorited gear available for this slot. Poor you :(");
  }
  
	picker.append('</table></div>');
	chitPickers["gear" + s] = picker;
}


void bakeGear() {
  buffer result;
  
  result.append('<table id="chit_gear" class="chit_brick nospace"><tbody>');
  result.append('<tr><th class="label" colspan="9"><a class="visit" target="mainpane" href="./inventory.php?which=2">Gear</a></th></tr>');
  
  void addSlot(slot s)
  {
    item equipped = equipped_item(s);
    result.append('<td><a class="chit_launcher" rel="chit_pickergear');
    result.append(s);
    result.append('" href="#"><img class="chit_gearicon hand" src="/images/itemimages/');
    if(equipped != $item[none])
    {
      result.append(equipped.image);
    }
    else
    {
      result.append('blank.gif');
    }
    result.append('" title="');
    result.append(s);
    result.append(': ');
    result.append(equipped);
    result.append('"></a></td>');
    pickerGear(s);
  }
  result.append('<tr>');
  foreach s in $slots[ hat, back, shirt, weapon, off-hand ]
    addSlot(s);
  if(!to_boolean(vars["chit.gear.wide"]))
    result.append('</tr><tr>');
  foreach s in $slots[ pants, acc1, acc2, acc3 ]
    addSlot(s);
  result.append('</tr>');
  result.append('</tbody></table>');
  
  chitBricks["gear"] = result.to_string();
}

EDIT: I also added in a setting to revert the gear icons to all show on one line, since I REALLY prefer it that way, but I can understand preferring a narrower pane (I like it wide), so I set the default to follow your behavior:

Code:
setvar("chit.gear.wide",false);
 
Last edited:
Added you latest change and a small bug fix by me. Along with some reformatting. Please resync with my version before posting any more changes.

Edit: Finished work on that commit before I saw your edit. I'll consider that later.
 
Last edited:
Will do. Might be done with changes on that end. But one thing I've noticed is that it can be kind of frustrating dealing with multiple pickers overlapping. I'm gonna look in to making it so that when a picker pops up, all other currently active pickers hide, unless you can think of a reason that that would cause issues, in which case I might make it specific to the gear pickers. Might take me a while though, as I'll have to familiarize myself with a bit of jquery, but that's a good thing to do anyway, so it's not a problem at all.

Alright, here's a few more minor tweaks to some styling and such, after updating to what you've committed.

Code:
// pickerGear and bakeGear were written by soolar
void pickerGear(slot s) {
	buffer picker;
	picker.pickerStart("gear" + s, "Change " + s);
	
	picker.addLoader("Changing " + s + "...");
  
	boolean any_options = false;
  
	void add_gear_option(string prefix, item it) {
		any_options = true;
		picker.append('<tr class="pickitem"><td class="icon"><img src="/images/itemimages/');
		picker.append(it != $item[none] ? it.image : equipped_item(s).image);
		picker.append('" class="hand" onclick="descitem(');
		picker.append(it != $item[none] ? it.descid : equipped_item(s).descid);
		picker.append(',0,event)" /></td><td><a href="');
		picker.append(it != $item[none] ? sideCommand("equip " + s + " " + it) : sideCommand("unequip " + s));
		picker.append('">');
		picker.append(prefix);
		picker.append(it != $item[none] ? it : equipped_item(s));
		picker.append('</a></td></tr>');
	}
  
	if(equipped_item(s) != $item[none]) {
		add_gear_option("<span style='font-weight:bold;'>unequip</span> ", $item[none]);
	}
  
	item it;
	foreach i,fav in split_string(vars["chit.favgear"], ",") {
		if(fav == "smiths")
			it = classSmiths();
		else
			it = to_item(fav);
		if(it != $item[none] && (it.to_slot() == s || (s == $slot[off-hand] && it.to_slot() == $slot[weapon] && have_skill($skill[double-fisted skull smashing]))) && equipped_item(s) != it) {
			if(available_amount(it) > 0)
				add_gear_option("", it);
			else if(creatable_amount(it) > 0)
				add_gear_option("<span style='color:red;font-weight:bold;'>create</span> ", it);
		}
	}

	if(!any_options)
		picker.addSadFace("You have no favorited gear available for this slot. Poor you :(");

	picker.append('</table></div>');
	chitPickers["gear" + s] = picker;
}

// pickerGear and bakeGear were written by soolar
void bakeGear() {
	buffer result;

	result.append('<table id="chit_gear" class="chit_brick nospace"><tbody>');
	result.append('<tr><th class="label" colspan="9"><a class="visit" target="mainpane" href="./inventory.php?which=2">Gear</a></th></tr>');

	void addSlot(slot s) {
		item equipped = equipped_item(s);
		result.append('<td><a class="chit_launcher" rel="chit_pickergear');
		result.append(s);
		result.append('" href="#"><img class="chit_gearicon hand" src="/images/itemimages/');
		if(equipped != $item[none])
			result.append(equipped.image);
		else
			result.append('blank.gif');
		result.append('" title="');
		result.append(s);
		result.append(': ');
		result.append(equipped);
		result.append('"></a></td>');
		pickerGear(s);
	}
	result.append('<tr>');
	foreach s in $slots[ hat, back, shirt, weapon, off-hand ]
		addSlot(s);
  if(!to_boolean(vars["chit.gear.wide"]))
    result.append('</tr><tr>');
	foreach s in $slots[ pants, acc1, acc2, acc3 ]
		addSlot(s);
	result.append('</tr>');
	result.append('</tbody></table>');

	chitBricks["gear"] = result.to_string();
}

Still need to add this in with the setvar calls:

Code:
setvar("chit.gear.wide",false);

I kinda wanna tweak it a bit so it says fold instead of create where that's appropriate, and maybe give the option to pull stuff in softcore. There's a bunch of room for minor polish things, but I'm pretty happy with where it is atm. I like the change you made with making create show in red/bold instead of all caps btw, very nice.

BTW this includes the stuff from the edit above that you missed, so don't bother with that post!
 
Last edited:
Added your changes with the small alteration that the name of the preference is "chit.size.wide" in case I ever want to apply it to another feature other than the gear changer.


But one thing I've noticed is that it can be kind of frustrating dealing with multiple pickers overlapping. I'm gonna look in to making it so that when a picker pops up, all other currently active pickers hide, unless you can think of a reason that that would cause issues, in which case I might make it specific to the gear pickers. Might take me a while though, as I'll have to familiarize myself with a bit of jquery, but that's a good thing to do anyway, so it's not a problem at all.

That is a very good idea. I cannot think of a single reason why that would cause a problem. Even with other pickers that aren't involved in the gear changer, it would be good to close them if a different picker is opened. It would be an improvement all around.
 
The same thing done to include weapons for the offhand slot needs to be done to put accessories in all 3 slots.
Code:
( ( s == $slot[acc2] || s == $slot[acc3] ) && it.to_slot() == $slot[acc1] ) )
 
Back
Top