Top

Secret Chronicles of the Scripting API documentation

Class BonusBox

Parent Box

Bonus Boxes contain powerups (or just look like that).

Class Methods

new

new() → a_bonus_box

Creates a new BonusBox with the default values.

Instance Methods

bonus_type

bonus_type() → a_symbol

Return the box’ current bonus type.

bonus_type=

bonus_type=( type ) → type

Specify the bonus box’ type.

Parameters

type

The bonus box’ new type. One of the following symbols:

empty

See undefined.

fireplant

Box containing a fireplant if Alex is big, a red mushroom otherwise.

goldpiece

Box containing a goldpiece. Specify the color via #goldcolor=.

mushroom_default

Box containing the normal red mushroom.

mushroom_blue

Box containing the blue ice mushroom if Alex is big, a red mushroom otherwise.

mushroom_ghost

Box containing a ghost mushroom.

mushroom_live_1

Box containing a 1-up mushroom.

mushroom_poison

Box containing a poison mushroo/dd

mushroom_red

See mushroom_default.

lemon

Box containing a lemon.

undefined

Empty box.

force_best_item=

force_best_item=( bool ) → bool

With regard to #bonus_type=, force always the best possible item to come out of the box, regardless of Alex’s state. That is, if you set #bonus_type= to :mushroom_blue, and Alex is small, AND you set this option, the box will spit out a blue mushroom nevertheless.

Parameters

bool

Whether or not to force the best item.

force_best_item?

force_best_item?() → true or false

Returns true if this box always contains the best possible item, false otherwise.

goldcolor

goldcolor() → a_symbol

Returns the color for goldpieces in this box. See #goldcolor= for possible return values.

goldcolor=

goldcolor=( color ) → color

Specify the color for goldpieces in the box. Only useful if you set #bonus_type to :goldpiece.

Parameters

color

The goldpiece color. One of default, :yellow, :red.