void ActorOps()
{
int act = GetVarOrDirectByte(OpCodeParameter.Param1);
int arg = GetVarOrDirectByte(OpCodeParameter.Param2);
int i;
_opCode = ReadByte();
if (act == 0 && _opCode == 5)
{
// This case happens in the Zak/MM bootscripts, to set the default talk color (9).
String[0].Color = (byte)arg;
return;
}
var a = Actors[act];
switch (_opCode)
{
case 1: // SO_SOUND
a.Sound = arg;
break;
case 2: // SO_PALETTE
if (Game.Version == 1)
i = act;
else
i = ReadByte();
a.SetPalette(i, (ushort)arg);
break;
case 3: // SO_ACTOR_NAME
a.Name = ReadCharacters();
break;
case 4: // SO_COSTUME
a.SetActorCostume((ushort)arg);
break;
case 5: // SO_TALK_COLOR
if (Game.GameId == GameId.Maniac && Game.Version == 2 && Game.Features.HasFlag(GameFeatures.Demo) && arg == 1)
a.TalkColor = 15;
else
a.TalkColor = (byte)arg;
break;
default:
throw new NotSupportedException(string.Format("ActorOps: opcode {0} not yet supported", _opCode));
}
}