GiveFn.java

codebase/src/net/sourceforge/pain/logic/fn/GiveFn.java · 712 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 GiveFn {

	public static void give(Creature source, Physical obj, Creature target) {
		RelocateFn.relocate(obj.asLocated(), target.getInventory());

		final Interactive iTarget = target.asInteractive();
		final Interactive iObj = obj.asInteractive();
		final Interactive iEquipped = source.asInteractive();

		MessageOutFn.outln(source, "You give " + iObj.getDesc() + " to " + iTarget.getName() + ".");
		MessageOutFn.outln(target, iEquipped.getName() + " gives you " + iObj.getName() + ".");
		MessageOutFn.outSpaceNoVictim(iEquipped, iTarget, "$n1 gives $n2 to $n3", iEquipped, iObj, iTarget, Receptive.SEE);
	}

}

Site Stats

Snippets: 1791
Codebases: 571