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:
And here's the code...
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: