GetFn.java

codebase/src/net/sourceforge/pain/logic/fn/GetFn.java · 699 B

From the archive pain_0_44.tgz

Download the archive   « Back to the archive contents

package net.sourceforge.pain.logic.fn;

import net.sourceforge.pain.data.type.*;

public class GetFn {

	public static void get(Creature creature, Physical target) {
		if (target.sameObjectAs(creature)) {
			MessageOutFn.outln(creature, "You can't do that.");
			return;
		}
		if (target.is(Creature.class)) { // maybe fight? maybe flag to fight?
			MessageOutFn.outln(creature, "You can't do that.");
			return;
		}
		RelocateFn.relocate(target.asLocated(), creature.getInventory());
		final Interactive iTarget = target.asInteractive();
		MessageOutFn.outln(creature, "You get " + iTarget.getDesc() + ".");
		MessageOutFn.outSpace(creature, "$n gets $P.", creature, iTarget, Receptive.SEE);
	}

}

Site Stats

Snippets: 1791
Codebases: 571