It's been quite a while since I find cool ideas to get ManiaScript to the max hype level. So here's my brain dump about this. Friends devs, feel free to add some of yours bellow.
1. Allow declaration of classes, enums
Code: Select all
Class CBonus {
declare CBonus::EBonusType Type;
declare Integer Level;
// Constructor
CBonus(CBonus::EBonusType _Type, Integer _Level) {
This.Type = _Type;
This.Level = _Level;
}
// Constructor overloading
CBonus(CBonus::EBonusType _Type) {
This.Type = _Type;
This.Level = 1;
}
Void ApplyBonusTo(CSmPlayer _Player) {
switch (This.Type) {
case CBonus::EBonusType::Stamina: {
if (_Player.StaminaMax < 3 - This.Level)
_Player.StaminaMax += MathLib::ToReal(This.Level);
else if (_Player.StaminaMax < 3)
_Player.StaminaMax = 3.;
}
case CBonus::EBonusType::Armor: {
if (_Player.ArmorMax < 10 - This.Level)
_Player.ArmorMax += MathLib::ToReal(This.Level);
else if (_Player.ArmorMax < 10)
_Player.ArmorMax = 10.;
}
}
}
}
Enum EBonusType {
Stamina, Armor;
}
The enum is just a simple list of names, separated with commas and ending with a semicolon.
Bellow is an example to instantiate a CBonus object.
Code: Select all
declare CBonus Foo <=> CBonus(CBonus::EBonusType::Armor, 2);
2. More control on <camera>, <audio>, <music>, <video> in ManiaLinks
Code: Select all
declare CMlAudio Music <=> (Page.GetFirstChild("audio") as CMlAudio);
while (True) {
if (!Music.Audio.DownloadInProgress && !Music.Audio.IsPlaying) {
Music.Audio.Play();
}
}
For <camera>, having multiple camera support would be cool.