GetFn.java

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

From the archive pain_0_42.zip

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(Equipped equipped, Physical target) {
		if (target.sameObjectAs(equipped)) {
			MessageOutFn.outln(equipped, "You can't do that.");
			return;
		}
		if (target.is(LifeForm.class)) { // maybe fight? maybe flag to fight?
			MessageOutFn.outln(equipped, "You can't do that.");
			return;
		}
		RelocateFn.relocate(target.asLocated(), equipped.getInventory());
		final Interactive iTarget = target.asInteractive();
		MessageOutFn.outln(equipped, "You get " + iTarget.getDesc() + ".");
		MessageOutFn.outSpace(equipped, "$n gets $P.", equipped, iTarget, Receptive.SEE);
	}

}

Site Stats

Snippets: 1791
Codebases: 571