home *** CD-ROM | disk | FTP | other *** search
- public class DoubleDoor extends Codex {
- private CodexThing _door = new CodexThing(((Codex)this).GetClassThing());
- private float _speed = 10.0F;
- private CodexThing _door2;
- private boolean bOpen;
- private boolean bActive;
- public static String[] _params = new String[]{"Movement speed;10.0", "Second half door"};
-
- public void clicked(int guid, int clickerGuid, int captureId) {
- if (!this.bActive) {
- this.bActive = true;
- if (!this.bOpen) {
- this._door.MoveToFrame(1, this._speed);
- this._door2.MoveToFrame(1, this._speed);
- this.bOpen = true;
- } else {
- this._door.MoveToFrame(0, this._speed);
- this._door2.MoveToFrame(0, this._speed);
- this.bOpen = false;
- }
-
- }
- }
-
- public void beginscene(int clientGuid, int captureID) {
- this._door.SetThingFlags(8192);
- this._door2.SetThingFlags(8192);
- }
-
- public void arrived(int thingGuid, int frameNum, int captureId) {
- this.bActive = false;
- }
-
- public DoubleDoor(float speed, CodexThing door2) {
- this._speed = speed;
- this._door2 = new CodexThing(((Codex)door2).GetGUID());
- ((Codex)this).CaptureThing(this._door2.GetGUID());
- if (this._door.GetDescriptionID().equalsIgnoreCase("PROP")) {
- this._door.SetDescriptionID("GEN_DOOR");
- }
-
- if (this._door2.GetDescriptionID().equalsIgnoreCase("PROP")) {
- this._door2.SetDescriptionID("GEN_DOOR");
- }
-
- }
-
- public void restore(int flags) {
- this.bOpen = CodexSequence.RestoreBoolean();
- }
-
- public void save(int flags) {
- CodexSequence.SaveBoolean(this.bOpen);
- }
- }
-