Feature - Rejected ASH Command for DoD Potions

bumcheekcity

Active member
I may be being stupid, but I can't see an ASH command to return a map of DoD potion names to their effect, like "!" effectively does in the CLI. Is there a chance we could get this?
 

Theraze

Active member
Well, could do it as a script that runs through the ids and displays their names? Just need to display 819-827. If you want the vials, that'd be same thing but 3885-3896. Displayed items do show their names if it's identified them...
 

Bale

Minion
It's a reasonably simple subroutine

PHP:
effect [item] DoDpotion() {
	effect [item] potion;
	for id from 819 to 827
		potion[id.to_item()] = get_property("lastBangPotion"+id).to_effect();
	return potion;
}
 

Bale

Minion
Okay, I tested it and that isn't as simple as it seemed.

PHP:
effect [item] DoDpotion() {
	effect [item] potion;
	for id from 819 to 827
		potion[id.to_item()] = get_property("lastBangPotion"+id).to_effect();
	return potion;
}

void main() {
	foreach pot, eff in DoDpotion()
		print(pot+": "+eff+" (have "+item_amount(pot)+")");
}

produces this output:

Code:
[COLOR="#ff0000"][sleepiness] does not match anything in the status effect database.
[confusion] does not match anything in the status effect database.
[inebriety] does not match anything in the status effect database.
[ettin strength] does not match anything in the status effect database.[/COLOR]
bubbly potion: none (have 1)
cloudy potion: Strange Mental Acuity (have 3)
dark potion: none (have 3)
effervescent potion: none (have 1)
fizzy potion: none (have 2)
milky potion: Teleportitis (have 1)
murky potion: none (have 1)
smoky potion: none (have 2)
swirly potion: none (have 2)

Still, the basic principle is sound. You just need a switch to transform mafia's description of the potion into valid effects. I'll leave that to bumcheekcity since it's a little annoying.
 

slyz

Developer
PHP:
effect [item] DoDpotion() {
    effect [item] potion;
    for id from 819 to 827
        switch( get_property("lastBangPotion"+id) ) {
                case "sleepiness": potion[id.to_item()] = $effect[ Sleepy ]; break;
                case "confusion": potion[id.to_item()] = $effect[ Confused ]; break;
                case "inebriety": potion[id.to_item()] = $effect[ Antihangover ]; break;
                case "ettin strength": potion[id.to_item()] = $effect[ Strength of Ten Ettins ]; break;
                default: potion[id.to_item()] = get_property("lastBangPotion"+id).to_effect();
        }
    return potion;
}

void main() {
    foreach pot, eff in DoDpotion()
        print(pot+": "+eff+" (have "+item_amount(pot)+")");
}
This wasn't tested (I can't open up Mafia right now). For the inebriety potion, I put the "Antihangover" effect.
 
Top