Exemplo n.º 1
0
public func Activate(oCaller, oClonk)
{                            
  if(!oClonk) oClonk = oCaller;
  // Effekt prüfen
  var iChkEff;
  if (iChkEff = CheckEffect("ExtinguishPSpell", oExtiObj, 180)) return(iChkEff!=-1 && RemoveObject());
  // Lavafässer zu Granit werden lassen
  var obj;
  if (obj = FindContents(LBRL, oClonk))
    if (!CheckEffect("ExtinguishPSpell", obj, 180))
    {
      var mat = "Granite";
      // Granit nicht geladen -> Stein casten
      if (!MaterialLoaded(Material(mat))) mat = "Rock";
      // Stein nicht geladen -> Kohle casten
      if (!MaterialLoaded(Material(mat))) mat = "Coal";
      // Material schleudern
      var amount = Min(400, obj->GetAmount()*3);
      CastPXS(mat, amount, 40, AbsX(GetX(oClonk)), AbsY(GetY(oClonk)));
      // Objekt entfernen
      RemoveObject(obj);
    }
  // Nächstes brennendes Objekt finden
  var oExtiObj, iExtiCount;
  // Den Clonk selbst?
  if(OnFire(oClonk)) 
    iExtiCount += DoExtinguish(oClonk, oCaller);
  // Nächstliegende Objekte
  SetPosition(GetX(oCaller), GetY(oCaller));
  // Suchradius ist abhängig von Höhe des Aufrufenden - ein Zauberturm hat einen größeren Radius
  var iSearchRadius = GetObjHeight(oCaller) * 3;
  while(oExtiObj = FindObject(0, 0, 0, -1, -1, 0, 0, 0, 0, oExtiObj))
    if(ObjectDistance(oCaller, oExtiObj) > iSearchRadius)
      break;
    else if(OnFire(oExtiObj))
      iExtiCount += DoExtinguish(oExtiObj, oCaller);
    else if (oExtiObj->~MagicExtinguish(oCaller))
      iExtiCount += DoExtinguish(oExtiObj, oCaller);
  // Irgendwas gelöscht?
  if (!iExtiCount) return(0, Message("$NoExtinguish$", oClonk), RemoveObject());
  // Einmaliger Effekt pro Zauber
  Sound("Splash1");
  return(true);
}
Exemplo n.º 2
0
public func Activate(oCaller, oClonk)
{                            
  if(!oClonk) oClonk = oCaller;
  // Effekt prüfen
  var iChkEff;
  if (iChkEff = CheckEffect("WarmPSpell", oExtiObj, 180)) return(iChkEff!=-1 && RemoveObject());
  // Nächstes gerforenes Objekt finden
  var oExtiObj, iExtiCount, pObj;
  // Den Clonk selbst?
  if(Frozen(oClonk)) 
    iExtiCount += DoUnfreeze(oClonk, oCaller);
  else if(oClonk->~MagicWarm(1800))
    iExtiCount += DoUnfreeze(oClonk, oCaller);
  else if(pObj = Contents(0,oClonk))
    if(GetID(pObj)==METL) if(GetDefHeight(ANML))
    {
      RemoveObject(pObj);
      CreateContents(ANML, oClonk);
      return(RemoveObject());
    }
  // Nächstliegende Objekte
  SetPosition(GetX(oCaller), GetY(oCaller));
  // Suchradius ist abhängig von Höhe des Aufrufenden - ein Zauberturm hat einen größeren Radius
  var iSearchRadius = GetObjHeight(oCaller) * 3;
  while(oExtiObj = FindObject(0, 0, 0, -1, -1, 0, 0, 0, 0, oExtiObj))
    if(ObjectDistance(oCaller, oExtiObj) > iSearchRadius)
      break;
    else if(Frozen(oExtiObj))
      iExtiCount += DoUnfreeze(oExtiObj, oCaller);
    else if (oExtiObj->~MagicUnfreeze(oCaller))
      iExtiCount += DoUnfreeze(oExtiObj, oCaller);
  // Irgendwas erwärmt?
  if (!iExtiCount)
  {
    Message("$NoUnfreeze$", oClonk);
    RemoveObject();
    return 0;
  }
  // Einmaliger Effekt pro Zauber
  Sound("Inflame");
  return(true);
}