wyvern.kernel.monsters
Class Petrifier

java.lang.Object
  extended bywyvern.kernel.monsters.Petrifier

public class Petrifier
extends java.lang.Object

Contains methods and utilities for turning objects to stone.

Version:
1.0, Nov 7, 2000
Author:
Steve Yegge

Constructor Summary
Petrifier()
           
 
Method Summary
 java.awt.Image createPetrifiedImage(java.awt.Image src)
          Creates a grayscale version of the image using the jdk 1.4 "headless" image-manipulation routines, so it works on a server that isn't running X.
 void createPetrifiedImageFile(java.lang.String filename)
          Takes an image file and creates a "petrified" version of it, writing it to a special directory in the game tree.
 java.lang.String getPetrifiedImagePath(java.lang.String path)
          Figures out the petrified version of
 java.awt.Image loadImage(java.lang.String path)
          Loads a GIF image in "headless" mode (i.e. doesn't use Toolkit.getDefaultToolkit(), which requires an X server)
static void main(java.lang.String[] args)
          Test.
 void petrify(GameObject attacker, GameObject obj)
          Turns the object to stone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Petrifier

public Petrifier()
Method Detail

createPetrifiedImageFile

public void createPetrifiedImageFile(java.lang.String filename)
Takes an image file and creates a "petrified" version of it, writing it to a special directory in the game tree. If it fails, no image is written.

Parameters:
filename - the relative path to the image, e.g. "monsters/misc/evil_eye.S" (no extension)

getPetrifiedImagePath

public java.lang.String getPetrifiedImagePath(java.lang.String path)
Figures out the petrified version of

Parameters:
path - the absolute path to the non-petrified version of the image
Returns:
the path where the server will put the petrified version, including the filename.

petrify

public void petrify(GameObject attacker,
                    GameObject obj)
Turns the object to stone. Currently only works on Monsters. Kills the monster, leaving no corpse, and creates a statue of the monster.

Parameters:
attacker -
obj - the monster to petrify

createPetrifiedImage

public java.awt.Image createPetrifiedImage(java.awt.Image src)
Creates a grayscale version of the image using the jdk 1.4 "headless" image-manipulation routines, so it works on a server that isn't running X.


loadImage

public java.awt.Image loadImage(java.lang.String path)
Loads a GIF image in "headless" mode (i.e. doesn't use Toolkit.getDefaultToolkit(), which requires an X server)

Parameters:
path - the relative image path ("monsters/misc/evil_eye.S")

main

public static void main(java.lang.String[] args)
Test.