Fisting skill script

Bale

Minion
My code works fine, but is very clunky. I cannot help thinking that there's a better and more elegant way for me to do this. Can anyone suggest how to improve it? The purpose of the script is to print helpful information that looks like this:

Code:
[COLOR="olive"]> fisting[/COLOR]

[B]You have learned 5 Fist Skills[/B]
   Flying Fire Fist
   Salamander Kata
   Drunken Baby Style
   Stinkpalm
   [B][COLOR="#ff4500"]Worldpunch[/COLOR][/B]

[B]Places left to learn Fist Skills[/B]
   Haunted Conservatory
   Frat House
   Menagerie 3
   Ninja Snowmen
   Poker Room
   White Citadel

And here's the code...

Code:
int fistSkillsKnown = get_property("fistSkillsKnown").to_int();
if(my_path() != "Way of the Surprising Fist") {
	print("You are not a follower of the Way of the Surprising Fist. These skills are beyond you.");
} else if(fistSkillsKnown > 10) {
	print_html("<b>All Fist Skills have been discovered!</b>");
} else {
	if(fistSkillsKnown > 0) {
		print_html("<b>You have learned "+fistSkillsKnown+" Fist Skills</b>");
		skill [int] fists;
		foreach s in $skills[Flying Fire Fist,Salamander Kata,Drunken Baby Style,Stinkpalm,Worldpunch,Knuckle Sandwich,
		  Seven-Finger Strike,Miyagi Massage,Chilled Monkey Brain Technique,Zendo Kobushi Kancho]
			fists[count(fists) + 1] = s;
		for i from 1 to fistSkillsKnown
			print_html("   "+(i==5? "<span style='color:#ff4500;font-weight:bold'>":"")+fists[i]+(i==5? "</span>":""));
	} else print_html("<b>You have learned no Fist Skills yet.</b>");

	print("");
	print_html("<b>Places left to learn Fist Skills</b>");
	location [string] places;
	places ["FratHouse"] = $location[frat house];
	places ["Menagerie"] = $location[menagerie 2];
	places ["Road"] = $location[White Citadel];
	foreach key in $strings[BarroomBrawl, BatHole, Conservatory, FunHouse, HaikuDungeon, NinjaSnowmen, PokerRoom, Slums]
		places[key] = to_location(key);
	foreach key in places
		if(!get_property("fistTeachings"+key).to_boolean())
			print_html("   "+places[key]);
}
 
Last edited:
I don't know about improving the code, but it makes a nice alias anyway, thanks :)

That was my intent actually, but I'm hoping to reduce the code before reformatting it for aliasing.

Does Menagerie 3 work as well? I've always used Menagerie 2.

Arrgh. No. That's obviously a bug. I'll fix it in the above post to avoid confusing anyone who might want to copy my work.


Yup. I noticed it, though reports on less info and not as compactly.
 
Back
Top