示例#1
0
文件: _evaluate.c 项目: ehershey/pd
int cmd_evaluate(string str) {
  object tp=this_player();
  object env=environment(tp);
  object tgt;
  mapping bod;
  string *limbs;
  string rep;
  
  if (!abil()) return 0;

  if (str)
    tgt = present(str, env);

  if (!can_cast(tp, tgt)) return 0;

  bod = tgt->query_body_mapping();

  // lowest ac limb at limbs[0]
  limbs = sort_array(keys(bod),
    function (string a, string b, object tgt) {
      if (tgt->query_ac(a) > tgt->query_ac(b))
        return 1;
      if (tgt->query_ac(a) < tgt->query_ac(b))
        return -1;
      else
        return 0;
    }, tgt);
示例#2
0
int cmd_maul(string str) {
  object tp=this_player();
  object tgt;
  object *weps;
  string wep, limb;
  int cost, dmg, rank;
  int wc=0;

  if (!abil()) return 0;

  if (tp->query_disable()) return 1;

  if (!str) tgt=tp->query_current_attacker();
  else tgt=present(str,environment(tp));

  weps = filter(tp->query_wielded(), (: $1->query_type() == TYPE :) );
  
  if (!ok_cast(tp,tgt,weps)) return 0;

  foreach (object w in weps)
    wc += w->query_wc();
  wc = wc / sizeof(weps);

  if (tp->query_skill(TYPE) >= 160) rank=3;
  else rank=2;
  
  dmg=BALANCE3_D->get_damage(tp, tgt, rank,
        ({ TYPE, "attack" }),
示例#3
0
int cmd_whack(string str) {
  object tp = this_player();
  object env = environment(tp);
  object tgt, wep;
  object *weps;
  string wepname;

  if (!abil()) return 0;

  if (str)
    tgt = present(str, env);
  else
    tgt = tp->query_current_attacker();

  weps = filter(tp->query_wielded(), (: $1->query_type() == "blunt" :) );

  if (!can_cast(tp, tgt, weps)) return 0;

  wep = weps[random(sizeof(weps))];
  wepname = remove_article(strip_color(wep->query_short()));
  wepname = replace_string(wepname, " (wielded)", "");

  message("combat", "You spin your "+wepname+" around.", tp);
  message("combat", tp->query_cap_name()+" spins "+tp->query_possessive()+
    " "+wepname+" around.", env, tp);

  tp->set_disable(2);

  call_out("do_whack_hit", 2, ({ tp, env, tgt, wep, wepname }) );
示例#4
0
文件: _focus.c 项目: ehershey/pd
int cmd_focus(string str) {
  object tp=this_player();
  object env=environment(tp);
  int heal, cost;

  if (!abil()) return 0;

  if (!can_cast(tp)) return 0;

  heal = tp->query_level();
  heal += random(heal*2);
  heal += tp->query_skill("healing")*1.2;
  heal += tp->query_skill("faith")/4;
  heal += tp->query_stats("wisdom")*3/4;

  if (heal > 150) heal = 150+(heal-150)/3;
  
  cost = heal/3.3;

  if (tp->query_mp() < cost)
    FAIL("Your magic is too low.");

  tp->add_mp(-cost);
  tp->set_disable(2);
  tp->set(FOCUS_PROP, time());
  tp->add_sp(heal);
  
  message("magic", COL+"You focus your chi into a boost of energy."+RES, tp);
  message("magic", COL+tp->query_cap_name()+" focuses inward."+RES, env, tp);
  
  return 1;
}
示例#5
0
int cmd_cripple(string str) {
  object tp=this_player();
  object env=environment(tp);
  object tgt;
  object wep;
  object *weps;
  string name, limb;
  int caught=0;

  if (!abil()) return 0;

  // both the limb name and the monster identifier can have spaces in them,
  // so start searching from the second-to-last word given for a monster
  // example: cripple stupid goblin 2 right leg
  // first looks for stupid goblin 2 right,
  // then stupid goblin 2 - bingo, found it.. so right leg is the limb
  if (str) {
    string *tmp = explode(str, " ");
    int i = sizeof(tmp);
    if (i == 1)
      tgt = present(str, env);
    else {
      for (i -= 2; i >= 0; i--) {
        if (tgt = present(implode(tmp[0..i], " "), env)) {
          limb = implode(tmp[i+1..<1], " ");
          break;
        }
      }
    }
  }
示例#6
0
文件: _dodge.c 项目: ehershey/pd
int cmd_dodge(string str) {
    object tp = this_player();
    object env = environment(tp);
    int rounds, bonus, cost;

    if (!abil()) return 0;

    if (!can_cast(tp)) return 0;

    rounds = 5 + tp->query_level()/10;
    rounds += tp->query_skill("defense")/(4*9);
    if (rounds > 8) rounds = 8 + ((rounds-8)/2);
    if (rounds > 12) rounds = 12 + ((rounds-12)/2);

    bonus = tp->query_skill("agility");

    cost = rounds*3 + bonus/11;

    if (tp->query_sp() < cost)
        FAIL("You are too tired.");


    tp->add_sp(-cost);
    tp->add_skill_bonus("defense", bonus, rounds*2);
    tp->set(DODGE_PROP, time()+rounds*2);

    message("combat", "You "+COL+"dodge"+RES+" around, trying not to get hit.", tp);
    message("combat", tp->query_cap_name()+" starts to "+COL+"dodge"+RES+
            " back and forth.", env, tp);

    return 1;
}
示例#7
0
int cmd_trip(string str) {
   int dmg;
   object ob, env, tp;
   if (!abil())
     return notify_fail("What?\n");
   env = environment(this_player());
   tp = this_player();
   if (!str) ob = this_player()->query_current_attacker();
   else ob = present(str, env);
   if (!ob || !ob->is_living())
     return notify_fail("You do not see that here.\n");
   if (ob==this_player())
     return notify_fail("You trip and fall down.\n");
   if(this_player()->query_ghost())
     return notify_fail("Hard to trip without a body..\n");
   if (this_player()->query_disable())
     return notify_fail("You are not oriented enough to do this.\n");
   if (environment(this_player())->query_property("no attack"))
     return notify_fail("Greater powers prevent your malice.\n");
   if ((int)this_player()->query_sp() < 20)
     return notify_fail("You are too tired.\n");
   if (ob->query_rest_type() == SIT)
     return notify_fail(ob->query_cap_name()+" is already on the ground!\n");
   if(!this_player()->kill_ob(ob)) {
      write(ob->query_cap_name()+" can't be attacked by you yet.");
      return 1;
    }
   tp->set_disable();
   dmg = tp->query_stats("dexterity");
   dmg -= (ob->query_stats("dexterity") / 2);
   if (dmg < random(25)) {
      write("You spin at "+ob->query_cap_name()+" and miss "+nominative(ob)+" and fall to the ground.");
      message("info", tp->query_cap_name()+" spins around on the ground and tries to trip you but misses and falls to the ground.", ob);
      message("info", tp->query_cap_name()+" spins around on the ground and tries to trip "+ob->query_cap_name()+" but misses and falls to the ground.",environment(ob), ({ tp, ob }));
示例#8
0
文件: _case.c 项目: ehershey/pd
int cmd_case(string str) {
  object tp = this_player();
  object env = environment(tp);
  object tgt;
  int value, tmp, s;
  mapping currval;

  if (!abil()) return 0;

  if (str) {
    tgt = present(str, env);
    if (!tgt || !tgt->is_living())
      tgt = present(str, tp);
  }

  if (!can_cast(tp, tgt, str)) return 0;

  tp->set_disable();
  tp->add_sp(-(3+random(3)));

  tmp = 100 -
    (tp->query_skill("stealing")/4 + tp->query_skill("perception")/5 +
    tp->query_stats("intelligence")/3);
  if (tmp < 0) tmp = 0;

  if (tgt->is_living()) {
    value = BALANCE3_D->get_steal(tp, tgt, 1,
      ({ "stealing", "stealth" }),
示例#9
0
int cmd_filch(string str) {
  object tp = this_player();
  object env = environment(tp);
  object tgt, bag, item;
  object *allbags, *allitems;
  string who, bagname, what;
  string mymsg, yourmsg, theirmsg;
  int rank, steal, exp, kill, outlaw, perc, stealskill, stolen, gotitem;
  int tmp;

  exp = gotitem = kill = outlaw = stealskill = stolen = 0;

  if(!abil()) return 0;

  if (str) {
    if (str[0..4] == "from ") str = str[5..<1];
    if (sscanf(str, "%s's %s", who, bagname) == 2) {
      tgt = present(who, env);
      if (tgt)
        bag = present(bagname, tgt);
    }
    else
      tgt = present(str, env);
  }

  if (tgt && !bag) {
    allbags = filter(all_inventory(tgt), (: $1->is_bag() :) );
    if (sizeof(allbags))
      bag = allbags[random(sizeof(allbags))];
  }
示例#10
0
文件: _warblade.c 项目: ehershey/pd
int cmd_warblade(string str) {
  object tp=this_player();
  object tgt;
  object *weps;
  string wep, limb;
  string *adverbs;
  int cost, dmg, rank;
  int wc;

  if (!abil()) return 0;

  if (!str) tgt=tp->query_current_attacker();
  else tgt=present(str,environment(tp));

  weps = filter(tp->query_wielded(), (: $1->query_type() == TYPE :) );
  
  if (!ok_cast(tp,tgt,weps)) return 0;

  foreach (object w in weps)
    wc += w->query_wc();
  wc = wc / sizeof(weps);

  if (tp->query_skill("attack") >= 50*6) rank=4;
  else rank=3;

  adverbs = ({ "terribly", "severely" });
示例#11
0
int cmd_backstar(string str) {
    object *weapons, *knives;
    object victim;
    int *wc;
    string *type;
    int i, tmp;
    if (!abil()) {
        write("What?\n");
        return 1;
    }
    if(!str) {
        notify_fail("Backstab whom?\n");
        return 0;
    }
    if (this_player()->query_class() != "rogue") {
        write("Only rogues may backstab.");
        return 1;
    }
    if (this_player()->query_rest_type()) {
        write("You can't do that while not on your feet.");
        return 1;
    }
    if(this_player()->query_ghost()) {
        notify_fail("Are you planning on killing them, too?\n");
        return 0;
    }
    if(this_player()->query_disable()) return 1;
    if(environment(this_player())->query_property("no attack")) {
        notify_fail("Some mystical force prevents you from that.\n");
        return 0;
    }
    if(this_player()->query_sp() < 5) {
        notify_fail("You are to tired to be backstabing.\n");
        return 0;
    }
    if((int)this_player()->query_skill("murder") < 5 ||
      !(string)this_player()->query_class()) {
        notify_fail("Don't you wish you were fast enough for that?\n");
        return 0;
    }
    if(!(victim = present(lower_case(str),environment(this_player())))) {
        notify_fail("You don't see the target here.\n");
        return 0;
    }
    if(victim == this_player()) {
        notify_fail("Backstab yourself?\n");
        return 0;
    }
    if(victim->query_ghost()) {
        notify_fail("Backstab whom?\n");
        return 0;
    }
    if(!living(victim)){
        notify_fail("You would look silly backstabbing that.\n");
        return 0;
    }
    wc = ({});
示例#12
0
文件: _build.c 项目: ehershey/pd
int can_cast(object tp, string type) {
  object env;
  string what;
  mixed *err;
  
  if (!tp) return 0;

  if (tp->query_disable() || tp->query_casting() || tp->query_magic_round())
    FAIL("You are busy.\n");

  if (member_array(type, keys(reqs)) == -1)
    FAIL("You cannot build that.\n");
  
  err=check_resources(tp, type);
  
  if (stringp(err[0]))
    FAIL("You do not have enough "+err[0]+" to make a "+type+".\n");

  env = environment(tp);

  if (present("build_"+type+"_ob",env))
    FAIL("There is already a "+type+" here.\n");

  switch (type) {
    case "shelter":
      if (env->query_property("shelter"))
        FAIL("You cannot build a shelter inside a shelter!\n");
    break;
    default:
  }
  
  return 1;
}

int cmd_build(string str) {
  object tp=this_player();
  object env=environment(tp);
  
  if (!abil()) return 0;

  if (!str || str == "")
    FAIL("Build what?\n");

  if (str == "campfire")
    str = "fire";

  if (!can_cast(tp, str))
    return 0;

  tp->set_disable();
  tp->set_paralyzed(6,"You are busy building a "+str+".");
  tp->add_sp(-(20+random(10)));

  message("info", "You begin to build a "+str+".", tp);
  message("info", tp->query_cap_name()+" begins to build a "+str+".", env, tp);

  call_out("build_"+str, 6, ({tp}) );
示例#13
0
文件: _pounce.c 项目: ehershey/pd
int cmd_pounce(string str) {
  object victim;
  int i, tmp;

  if (!abil()) 
    return notify_fail("What?\n");

  if(!str)
    return notify_fail("Pounce whom?\n");

  if (this_player()->query_rest_type())
    return notify_fail("You are not in a position to perform that action\n");

  if(this_player()->query_ghost())
    return notify_fail("You appear to be dead.\n");

  if(this_player()->query_busy()) return notify_fail("You are busy.");

  if(environment(this_player())->query_property("no attack"))
    return notify_fail("Some mystical force prevents you from that.\n");

  if(this_player()->query_sp() < 25)
    return notify_fail("You are too tired to pounce on your victim.\n");

  if(!(victim = present(lower_case(str),environment(this_player())))) 
    return notify_fail("You do not see that here.\n");

  if(victim == this_player())
    return notify_fail("Pounce on yourself?\n");

  if(!living(victim))
    return notify_fail("You can not pounce on that.\n");

  if(member_array(victim, (object *)this_player()->query_hunted()) != -1 ||
   member_array(victim, (object *)this_player()->query_attackers())!=-1) {
    return notify_fail("You have lost the element of surprise!\n");
  }

  if(this_player()->query_current_attacker())
    return notify_fail("You are already in combat with something else!\n");

  if(victim->is_player() && !interactive(victim)) return 0;

  if (victim->query_skill("perception") + victim->query_stats("wisdom") >
   this_player()->query_skill("nature"))
    tell_object(victim, ""+this_player()->query_cap_name()+" attempts to sneak behind you unnoticed!");

  this_player()->set_paralyzed(1,"You are concentrating on your meal.");

  call_out("do_dmg", 1, victim, this_player());

  write("You sneak around behind "+victim->query_cap_name()+"!");

  return 1;
}
示例#14
0
文件: _disarm.c 项目: ehershey/pd
int cmd_disarm(string str) {
    object tp, ob;
    int def1, def2;

    if (!abil()) {
        return 0;
    }
    tp = this_player();
    if(tp->query_ghost()) {
        notify_fail("You are dead and cannot do that.\n");
        return 0;
    }
    if(tp->query_disable()) return 1;
    if (environment(tp)->query_property("no attack")) {
        notify_fail("You cannot disarm here.\n");
        return 0;
    }
    if((int)tp->query_sp() < 20) {
        notify_fail("You are too exhausted to try and disarm anything.\n");
        return 0;
    }
    if(str)
        if(present(str, environment(tp)))
            tp->kill_ob(present(str, environment(tp)));
        else
            return notify_fail("That is not here to disarm!\n");
    if(!(ob = (object)tp->query_current_attacker())) {
        notify_fail("You are not in battle.\n");
        return 0;
    }
    if(!sizeof((object *)ob->query_wielded())) {
        notify_fail("They are not wielding anything!\n");
        return 0;
    }
    tp->set_disable();
    def1 = (int)tp->query_skill("attack") + (int)tp->query_stats("dexterity");
    def2 = (int)ob->query_skill("defense") + (int)ob->query_stats("dexterity");
    def2 = def2/2 + random(def2/2);
    if(def1 >= def2) {
        write("You disarm "+(string)ob->query_cap_name()+"!\n");
        say(tp->query_cap_name() + " manages to disarm " +
            (string)ob->query_cap_name()+"!\n");
        ob->force_me("unwield "+(string)(ob->query_wielded()[0])->query_id()[0]);
    }
    else {
        write("You fail to disarm "+(string)ob->query_cap_name()+".\n");
        say(tp->query_cap_name()+ " tries to disarm "+(string)ob->query_cap_name()+".\n");
        tp->add_sp(-10);
        return 1;
    }
    def1 = (int)tp->query_skill("attack");
    tp->add_skill_points("attack", def1/20 );
    tp->add_sp(-10 - random(15));
    return 1;
}
示例#15
0
int cmd_eagledive(string str) {
  object tp = this_player();
  object env = environment(tp);
  object tgt, tgtenv;
  string tgtname, dir = "";
  mixed tmp;

  if (!abil()) return 0;

  // last word is the exit name, exits cannot contain spaces
  if (str && (tmp = strsrch(str, " ", -1)) != -1) {
    tgtname = str[0..tmp-1];
    dir = str[tmp+1..<1];
  }
示例#16
0
int cmd_flick(string str) {
   int dmg, x;
   string type, who;
   object ob, *weapons, env;

   if (!abil())
    return notify_fail("What?\n");
   if (!str) return notify_fail("Syntax: <flick [currency] at [who]>\n");
   if (sscanf(str, "%s at %s", type, who) != 2) type = str;
   switch(type) {
     case "platinum": x = 40; break;
     case "gold":     x = 25; break;
     case "electrum": x = 20; break;
     case "silver":   x = 15; break;
     case "copper":   x = 5; break;
     default: if (this_player()->query_money(type)) x = 10;
              else return notify_fail("Syntax: <flick [currency] at [who]>\n");
   }
   env = environment(this_player());
   if (!who) ob = this_player()->query_current_attacker();
   else ob = present(who, env);
   if (!ob || !ob->is_living())
     return notify_fail("You do not see that here.\n");
   if (!this_player()->query_money(type))
     return notify_fail("You do not have a coin of that currency!\n");
   if (ob==this_player())
     return notify_fail("You toss a "+type+" coin into the air and catch it.\n");
   if(this_player()->query_ghost())
    return notify_fail(
       "You cannot do that in your .. well... face it.. You're dead.\n");
   if (this_player()->query_disable())
     return notify_fail("You are not oriented enough to do this.\n");
   if (environment(this_player())->query_property("no attack"))
     return notify_fail("Greater powers prevent your malice.\n");
   if ((int)this_player()->query_sp() < 20)
    return notify_fail("You are too tired.\n");
   if (!this_player()->kill_ob(ob));
   this_player()->set_disable();
   this_player()->add_money(type, -1);
   dmg = random(this_player()->query_stats("strength")/10);
   dmg += random(this_player()->quey_level()/2);
   dmg += x;
   write("%^YELLOW%^You flick a %^RESET%^%^ORANGE%^"+type+" %^BOLD%^coin at "
     "%^RESET%^%^ORANGE%^"+ob->query_cap_name()+"%^BOLD%^!"); 
   say("%^YELLOW%^"+this_player()->query_cap_name()+" flicks a %^RESET%^%^ORANGE%^"
     +type+" %^BOLD%^coin at %^RESET%^%^ORANGE%^"+ob->query_cap_name()+"%^BOLD%^!",
     this_player());
   ob->damage(dmg);
   return 1;
}
示例#17
0
文件: _aim.c 项目: ehershey/pd
int cmd_aim(string str) {
    string what, whom;
    object ob;

   if (!abil()) {
      write("What?\n");
      return 1;
   }
    if(!str) {
        notify_fail("Aim for what?\n");
        return 0;
    }
    if(this_player()->query_disable()) return 1;
    this_player()->set_disable();
    if((int)this_player()->query_sp() < 1) {
        notify_fail("You are too tired.\n");
        return 0;
    }
    if(sscanf(str, "for %s on %s", what, whom) != 2) {
      what = str;
      ob = (object)this_player()->query_current_attacker();
      if(!ob) {
        notify_fail("Aim for what on whom?\n");
        return 0;
      }
    }
    else {
      ob = present(lower_case(whom), environment(this_player()));
      if(!ob) ob = parse_objects(environment(this_player()), lower_case(whom));
      if(!ob) {
        notify_fail("No "+capitalize(whom)+" here.\n");
        return 0;
      }
    }
    if(!living(ob)) {
      notify_fail("That is not a living thing!\n");
      return 0;
    }
    if(!ob->query_is_limb(lower_case(what))) {
      notify_fail(ob->query_cap_name()+" has no "+what+".\n");
      return 0;
    }
    write("You aim for "+ob->query_cap_name()+"'s "+what+".");
    say(this_player()->query_cap_name()+" concentrates on "+ob->query_cap_name()+".");
    if(random(101) < (int)this_player()->query_skill("attack"))
      ob->set_target_limb(lower_case(what));
    this_player()->add_sp(-random(2)-1);
    return 1;
}
示例#18
0
文件: _dragonfury.c 项目: ehershey/pd
int cmd_dragonfury(string str) {
   object ob, tp, env, *blah;
   tp = this_player();
   env = environment(tp);

   if (!abil())
      return 0;

    if (!str || str == "")
      ob=tp->query_current_attacker();
    else
      ob=present(str, env);

   if (tp->query_class() != "dragon")
      return 0;

   if (!ob) {
      notify_fail("Call dragonfury upon who?\n");
      return 0;
   }

   if (tp->query_level() < 12)
      return notify_fail("You cannot do that here.\n");

   if (env->query_property("no attack") || env->query_property("no magic"))
      return notify_fail("Greater powers prevent your malice.\n");

   if (!living(ob))
      return notify_fail("You cannot call fury upon an inanimate object!\n");

   if (tp->query_ghost())
      return notify_fail("You cannot do that in your incorporeal form.\n");

   if (tp->query_busy())
      return notify_fail("You are busy.\n");

   if (ob == tp)
      return notify_fail("And give up your own life??\n");

   if (tp->query_sp() < 50) 
      return notify_fail("You are too tired.\n");

  if (!(tp->kill_ob(ob))) return notify_fail("You cannot attack that.\n");

   tp->set_magic_round();
   tp->paralyze(3, "You dare not break your concentration!");
   write("%^RESET%^%^BOLD%^%^B_BLUE%^You ask the dragons of long ago to come to your aid...");
   blah = ({ tp , ob });
示例#19
0
文件: _flirt.c 项目: ehershey/pd
int cmd_flirt(string str) {
  int i, ppl;
  object *inv;
  object tp=this_player();
  if (!abil()) {
    message("info","What?",tp);
    return 1;
  }
  
  if (tp->query_current_attacker()) {
    message("info","You cannot take the time while in battle!",tp);
    return 1;
  }
  
  if (environment(tp)->query_property("no magic")) {
    message("info","You can't flirt here.",tp);
    return 1;
  }
  if (tp->query_property("flirt")) {
    message("info","You are already flirting.",tp);
    return 1;
  }
  if (tp->query_mp() < 50) {
    message("info","You don't have the energy to flirt right now.",tp);
    return 1;
  }
  
  if (tp->query_stats("charisma") < 9+random(3)) {
    message("info","You do not have enough natural attraction to flirt.",
      tp);
    return 1;
  }
  
  inv=all_inventory(environment(tp));
  for (i=0,ppl=0; i<sizeof(inv); i++) {
    if (living(inv[i]) && inv[i] != tp) ppl++;
  }
  if (ppl == 0) {
    message("info","There is nobody here to flirt with!",tp);
    return 1;
  }
  message("info","You begin to flirt with those around you.",tp);
  tp->add_mp(-(35+random(5)));
  tp->set_disable();  
  call_out("flirt1", 2+random(3), tp, ppl);
  
  return 1;
}
示例#20
0
int cmd_snatch(string str) {
    object tp=this_player();
    object tgt;
    object item, *inv;

    int dex, knife, stealing;
    int tdex, tdef, tsteal;
    int cost, dmg;

    string limb;

    if (!abil()) return 0;

    if (tp->query_disable()) return 1;

    if (!str) tgt=tp->query_current_attacker();
    else tgt=present(str,environment(tp));

    if (!ok_cast(tp,tgt)) return 0;

    dex=tp->query_stats("dexterity");
    knife=tp->query_skill("knife");
    stealing=tp->query_skill("stealing");
    stealing+=tp->query_skill("stealth")*2/3;

    tdex=tgt->query_stats("dexterity");
    tdef=tgt->query_skill("defense");
    tsteal=tgt->query_skill("perception");
    tsteal+=tgt->query_property("snatch");

    dmg=dex*2+knife*2+random(tp->query_level()+10);
    dmg-=tdef/3;
    cost=dmg/9;

    if (tp->query_sp() < cost)
        FAIL("You are too tired.\n");

    tp->set_disable(1);
    tp->add_sp(-cost);

    if (tdex*2/3 > dex) {
        message("combat",COL+"You take a swing at "+tgt->query_cap_name()+
                " with your knife, but miss."+RES,tp);
        message("combat",COL+tp->query_cap_name()+" swings "+tp->query_possessive()+
                " knife at "+tgt->query_cap_name()+", but misses."+RES,
                environment(tp),({tp,tgt}));
示例#21
0
文件: _peek.c 项目: ehershey/pd
int cmd_peek(string str) {
    object ob;
 
   if (!abil()) {
      return 0;
   }
    if(!str) {
        notify_fail("Peek at what?\n");
        return 0;
    }
    str = lower_case(str);
    if(str = this_player()->query_name()) return 0;
    if(sscanf(str, "at %s", str) != 1) {
        notify_fail("Peek at what?\n");
        return 0;
    }
    if(this_player()->query_disabled()) return 1;
    this_player()->set_disabled();
    ob = environment(this_player());
    if(effective_light(this_player()) < 0) {
        write("It is too dark.");
        return 1;
    }
    if(total_light(this_player()) < 1) write("It is dark.\n");
    if(ob->id(str)) 
        write((string)ob->query_long(str));
    else if(ob = present(str, this_player()))
        write((string)ob->query_long(str));
    else if(ob = present(str, environment(this_player()))) 
        write((string)ob->query_long(str));
    else {
        write("You do not notice that here.");
        return 1;
    }
/*    if(random(40) > (int)this_player()->query_skill("stealth")) {
        if(living(ob)) {
          say(this_player()->query_cap_name()+" glances at "+ob->query_cap_name()+" slyly.", ob);
          tell_object(ob, this_player()->query_cap_name()+" glances at you slyly.");
        }
        else
          say(this_player()->query_cap_name()+" looks over the "+str+".");
    }
    else */ this_player()->add_skill_points("stealth", 1);
    return 1;
}
示例#22
0
int cmd_flash(string str) {
  object tp = this_player();
  object env = environment(tp);
  object tgt;
  object *weps;
  int time, hit, miss;

  if (!abil()) return 0;

  if (str)
    tgt = present(str, env);
  else
    tgt = tp->query_current_attacker();

  weps = filter(tp->query_wielded(), (:
    ($1->query_type() == "blade" || $1->query_type() == "knife")
  :) );

  if (!can_cast(tp, tgt, weps)) return 0;

  tp->add_sp(-(3+random(5)));

  hit = tp->query_skill("blade");
  hit += tp->query_skill("entertainment");
  hit += tp->query_level();
  if (sizeof(weps) > 1 && tp->query_skill("double wielding") >= 20*5)
    hit += hit*15/100;
  if (tp->query_current_attacker())
    hit -= hit*20/100;

  miss = tgt->query_skill("defense");
  miss += tgt->query_skill("perception");
  miss += tgt->query_level();
  if (tgt->query(FLASH_PROP) > time() || tgt->query_property("no blind"))
    miss = hit+50;

  hit -= miss;

  if (hit < 1) {
    message("info", "You try to blind "+tgt->query_cap_name()+", but "+
      tgt->query_subjective()+" notices your attempt!", tp);
    message("info", "You notice "+tp->query_cap_name()+" trying to "
      "flash light into your eyes!", tgt);
    message("info", tp->query_cap_name()+" tries to flash light into "+
      tgt->query_cap_name()+"'s eyes, but fails.", env, ({ tp, tgt }) );
示例#23
0
文件: _perform.c 项目: ehershey/pd
int cmd_perform(string str) {
  string dance;
  object tp=this_player();
  
  if (!abil()) {
    message("info","What?",tp);
    return 1;
  }
  if (!str) {
    list_dances();
    return 1;
  }
  if (tp->query_disable()) {
    message("info","You are too busy to dance.",tp);
    return 1;
  }
  if (tp->query_rest_type()) {
    message("info","You cannot dance unless you are standing up.",tp);
    return 1;
  }
  if (present("gypsy_dance_obj",tp)) {
    message("info","You are already dancing!",tp);
    return 1;
  }
  if (find_dance(str))
    dance=find_dance(str);
  else {
    if (dance) dance->remove();
    message("info","You don't know that dance.",tp);
    return 1;
  }
  if (!dance->can_dance(tp)) {
    if (dance) dance->remove();
    message("info","You don't know that dance.",tp);
    return 1;
  }
  if (tp->query_sp() < 60) {
    if (dance) dance->remove();
    message("info","You are too tired to dance.",tp);
    return 1;
  }  
  dance->move(tp);
  dance->start_dance();
  return 1;
}
示例#24
0
int cmd_swoop(string str) {
    object tp = this_player();
    object env = environment(tp);
    object tgt;
    string *skills;
    int dmg, cost, rank;
    int miss = 0;

    if (!abil()) return 0;

    if (str)
        tgt = present(str, env);
    else
        tgt = tp->query_current_attacker();

    if (!can_cast(tp, tgt)) return 0;

    skills = ({ "attack", "flying", "flying" });
示例#25
0
int cmd_iceblast(string str) {
  object tp=this_player();
  object tgt;

  int cost, dmg;

  if (!abil()) return 0;

  if (tp->query_disable()) return 1;

  if (!str) tgt=tp->query_current_attacker();
  else tgt=present(str,environment(tp));

  if (!ok_cast(tp,tgt)) return 0;
  
  if (tp->query_level() >= 40)
    dmg=BALANCE_D->get_damage(tp, tgt, 3,
          ({"faith","faith","breath","breath","breath"}),
示例#26
0
文件: _fireshot.c 项目: ehershey/pd
int cmd_fireshot(string str) {
  object tp=this_player();
  object tgt;
  string howbig;
  int cost, dmg;

  if (!abil()) return 0;

  if (tp->query_disable()) return 1;

  if (!str) tgt=tp->query_current_attacker();
  else tgt=present(str,environment(tp));

  if (!ok_cast(tp,tgt)) return 0;
  
  if (tp->query_level() >= 60) {
    dmg=BALANCE3_D->get_damage(tp, tgt, 4,
          ({"attack", "breath", "breath", "flying"}),
示例#27
0
文件: _bite.c 项目: ehershey/pd
int cmd_bite (string str) {

    int attack, total;
    object ob;
    if(this_player()->query_race() == "vampire") return
            "/cmds/vamp/_bite.c"->cmd_bite(str);
    if (!abil())
        return 0;
    if(this_player()->query_ghost()) {
        notify_fail("You cannot do that as a ghost.\n");
        return 0;
    }
    ob = (object)this_player()->query_current_attacker();
    if(!ob || !living(ob)) {
        notify_fail("That is not here.\n");
        return 0;
    }
    if (this_player()->query_disable())
    {
        write("You are off balance.");
        return 1;
    }

    if(this_player()->query_casting()) return 1;
    if(!this_player()->kill_ob(ob)) {
        write(ob->query_cap_name()+" can't be attacked by you yet.");
        return 1;
    }
    if(environment(this_player())->query_property("no attack")) {
        notify_fail("You cannot do that here.\n");
        return 0;
    }
    if((int)this_player()->query_sp() < 30) {
        notify_fail("You are too tired.\n");
        return 0;
    }
    this_player()->set_disable();
    if (((this_player()->query_skill("attack") / 5) -
            (ob->query_skill("defense") / 9 )) + 40 +
            ((this_player()->query_stats("strength")/4 -
              ob->query_stats("dexterity")/8)) < 1)
    {
        write("You miss your opponent.");
        tell_room(environment(this_player()), this_player()->query_cap_name()+" tries to bite "+ob->query_cap_name()+"!", ({ ob, this_player() }));
示例#28
0
文件: _darkshift.c 项目: ehershey/pd
int cmd_darkshift(string str) {
    object ob;    
    int stealth, faith, intelligence, dex, stlth;

   if (!abil()) {
      notify_fail("What?\n");
      return 0;
   }
   if(this_player()->query_ghost()) return 0;
   if(this_player()->query_invis()) 
   { 
       notify_fail("You are already walking in darkness.\n");
       return 0;
   }
    stlth = (int)this_player()->query_skill("stealth");
    dex = (int)this_player()->query_stats("dexterity");
    faith = (int)this_player()->query_skill("faith");
    intelligence = (int)this_player()->query_stats("intelligence");
    stealth = ((stlth/3)+(dex)+(intelligence)+(faith/3));

    if(stealth < 15) {
        notify_fail("The demons laugh at you.\n");
        return 0;
    }
   if((int)this_player()->query_sp() < 50) {
        notify_fail("You are too tired.\n");
        return 0;
    }
   if((int)this_player()->query_mp() < 75) {
      notify_fail("You lack the magical energy needed.\n");
      return 0;
    }

    this_player()->set_invis();
    call_out("take_off", ((stlth/2)+dex+random(faith/2)), this_player());

    this_player()->add_mp(-((faith/3)+random(faith/3)));

    write("%^BLUE%^You shift into %^BOLD%^%^BLACK%^darkness%^RESET%^%^BLUE%^ and become completely undetectable!%^RESET%^\n");
    return 1;


}
示例#29
0
int cmd_taunt(string str) {
  object tp=this_player();
  object ob, tauntob;
  int chr, level, wis;

  if (!abil()) return 0;
  if (tp->query_disable()) return 1;

  if (sizeof(tp->query_attackers()))
    BAIL("You can't do that while fighting!\n");

  if (!ob=present(str,environment(tp)))
    BAIL("You don't see that here.\n");

  if (tp==ob) 
    BAIL("Neener neener neener.\n");

  if (!(tp->kill_ob(ob) || ob->kill_ob(tp)))
    BAIL("You can't start fighting with that.\n");

  chr=tp->query_stats("charisma");
  level=tp->query_level();
  wis=ob->query_stats("wisdom");

  if (tp->query_sp() < 50)
    BAIL("You're too tired to do that right now.\n");

  ob->add_skill_bonus("defense",-(chr*2/3+level-wis*2/3),level*4/3);
  ob->add_skill_bonus("attack",(chr*2/3+level)/2,level*4/3);
  tauntob=new(PLACE"tauntob");
  tauntob->move(ob);
  tauntob->set_owner(tp);
  tauntob->heart_beat();

  tp->set_disable(2);
  tp->add_sp(-(chr/3+wis/3+level/3));

  message("info","You run around "+ob->query_cap_name()+", shouting and making obscene gestures!",tp);
  message("info",tp->query_cap_name()+" runs around you, shouting and making obscene gestures.\n"
    "%^RED%^You feel the need to hurt "+tp->query_objective()+" badly!%^RESET%^",ob);
  message("info",tp->query_cap_name()+" runs around "+ob->query_cap_name()+", shouting and making obscene "
    "gestures!", environment(tp), ({tp, ob}));
示例#30
0
文件: _discern.c 项目: ehershey/pd
int cmd_discern(string str) {
    string x, limbs;
    object tp, ob;

    tp = this_player();
    if (!abil()) {
        notify_fail("What?\n");
        return 0;
    }
    if((string)tp->query_class() != "fighter") return 0;
    if(!str) return notify_fail("Discern what?\n");
    if(tp->query_sp() < 5) {
        notify_fail("You fail.\n");
        return 0;
    }
    ob = present(str, tp);
    if(!ob) ob = parse_objects(tp, str);
    if(!ob) {
        notify_fail("No "+str+" here!\n");
        return 0;
    }
    x = (string)ob->query_type();
    if(!x) {
        notify_fail("That is neither armour or a weapon!\n");
        return 0;
    }
    if(!ob->query_wc()) {
        if(!limbs=ob->query_limbs())
            return notify_fail("That is neither armour or a weapon!\n");
        tp->add_sp(-10);
        message("info", sprintf("%s is of type %s.", capitalize(str),
                                x), tp);
        message("info", sprintf("%s covers your : ", capitalize(str)),
                tp);
        message("info", sprintf("%s", format_page(limbs, 5)), tp);
        return 1;
    }
    message("info", sprintf("%s is of type %s.", capitalize(str), x), tp);
    tp->add_sp(-5);
    return 1;
}