roguelike吧 关注:6,901贴子:20,002

【powder】拆开源代码发现的一些东西

只看楼主收藏回复



IP属地:天津1楼2022-10-30 20:06回复
    我十年后又回来发帖了,。jeff lait先生在自己的个人网站公开了POWDER的源代码,它发布的所有文件都可以用记事本TXT形式打开,非常容易读懂,但是我发现了一些让我非常费解的东西


    IP属地:天津2楼2022-10-30 20:08
    回复


      IP属地:天津3楼2022-10-30 20:09
      回复
        这个源代码里的图片文件 代表了POWDER所有可能用到的图标,英文论坛上10年前就有人发过,除了占空位置用的空白图表外,有几个我不认识????是啥


        IP属地:天津4楼2022-10-30 20:10
        回复

          这个位于 狗头人 刺客 和酸水池 图表中间的这个手一样的图标是什么东西?????我从来没见过


          IP属地:天津5楼2022-10-30 20:11
          回复
            这个心脏是什么?不是巴尔的黑色心脏
            电子虫和老鼠中间的这个是什么


            IP属地:天津6楼2022-10-30 20:13
            回复
              INTRINSIC_NAMESint_good[] =
              {
              INTRINSIC_FAST,
              INTRINSIC_UNCHANGING,
              INTRINSIC_RESISTSTONING,
              INTRINSIC_RESISTFIRE,
              INTRINSIC_RESISTCOLD,
              INTRINSIC_RESISTSHOCK,
              INTRINSIC_RESISTACID,
              INTRINSIC_RESISTPOISON,
              // INTRINSIC_RESISTPHYSICAL, // I think this is too powerful.
              INTRINSIC_TELEPORTCONTROL,
              INTRINSIC_REGENERATION,
              INTRINSIC_REFLECTION,
              INTRINSIC_SEARCH,// In someways, this is bad :>
              INTRINSIC_INVISIBLE,
              INTRINSIC_SEEINVISIBLE,
              INTRINSIC_TELEPATHY,
              INTRINSIC_NOBREATH,
              INTRINSIC_LIFESAVE,// You don't want this on +7 sword :>
              // Especially if it kicks in prior to
              // your amulet :>
              INTRINSIC_RESISTSLEEP,
              INTRINSIC_FREEDOM,
              INTRINSIC_WATERWALK,
              INTRINSIC_JUMP,
              INTRINSIC_WARNING,
              INTRINSIC_DIG,
              INTRINSIC_NONE


              IP属地:天津7楼2022-10-30 20:14
              回复
                开源代码里说 艺术品本来是有 “物理攻击免疫”这个属性的,但是莱特先生认为这个属性过于变态,给他打上了注释号


                IP属地:天津8楼2022-10-30 20:15
                回复
                  INTRINSIC_NAMESint_bad[] =
                  {
                  INTRINSIC_SLOW,
                  INTRINSIC_TELEPORT,
                  INTRINSIC_TELEFIXED,
                  INTRINSIC_POSITIONREVEALED,
                  INTRINSIC_MISSINGFINGER,
                  INTRINSIC_MAGICDRAIN,
                  INTRINSIC_BLEED,
                  INTRINSIC_VULNSILVER,
                  INTRINSIC_VULNFIRE,
                  INTRINSIC_VULNCOLD,
                  INTRINSIC_VULNACID,
                  INTRINSIC_VULNSHOCK,
                  INTRINSIC_VULNPHYSICAL,
                  INTRINSIC_BLIND,
                  INTRINSIC_STRANGLE,
                  INTRINSIC_TIRED,
                  INTRINSIC_AFLAME,// Look forward to fireresist + aflame :>
                  INTRINSIC_POLYMORPH,
                  INTRINSIC_NOISY,
                  INTRINSIC_DEAF,
                  INTRINSIC_CONFUSED,
                  INTRINSIC_AMNESIA,
                  INTRINSIC_NOREGEN,
                  INTRINSIC_NONE
                  };


                  IP属地:天津9楼2022-10-30 20:17
                  回复
                    坏的属性里 INTRINSIC_NOREGEN, INTRINSIC_TIRED,INTRINSIC_POSITIONREVEALED,我从来没遇到过。。。。。不知道是什么意思,第二个累了我知道变成龙以后不能喷火了,但是还有啥其他的?负面效果?第三个是不是一直中毒?


                    IP属地:天津10楼2022-10-30 20:18
                    收起回复
                      if (hasIntrinsic(INTRINSIC_ASLEEP))
                      {
                      intnoisethreshold = 10;
                      if (hasIntrinsic(INTRINSIC_TIRED))
                      {
                      noisethreshold = 20;
                      // A small chance of clearing the tired intrinsic early!
                      if (!rand_choice(20))
                      {
                      clearIntrinsic(INTRINSIC_TIRED);
                      }
                      }
                      if (isAvatar())
                      {
                      // If we are the avatar, we check all other mobs to
                      // see if any of them will wake us.
                      // Technically, all mobs should use this code path,
                      // but we do have to worry about efficiency somewhere.
                      MOB*mob;
                      for (mob = glbCurLevel->getMobHead(); mob; mob = mob->getNext())
                      {
                      // Ignore our own noise!
                      if (mob == this)
                      continue;
                      intnoise, dist;
                      noise = getNoiseLevel(mob);
                      dist = abs(getX() - mob->getX())
                      + abs(getY() - mob->getY());
                      noise -= dist;
                      if (noise > 0)
                      {
                      if (rand_choice(noisethreshold) < noise)
                      {
                      clearIntrinsic(INTRINSIC_ASLEEP);
                      // Can stop the search.
                      break;
                      }
                      }
                      }
                      }
                      else if (getAvatar())
                      {
                      intnoise, dist;
                      noise = getAvatar()->getNoiseLevel(this);
                      dist = abs(getAvatar()->getX() - getX())
                      + abs(getAvatar()->getY() - getY());
                      noise -= dist;
                      if (noise > 0)
                      {
                      if (rand_choice(noisethreshold) < noise)
                      clearIntrinsic(INTRINSIC_ASLEEP);
                      }
                      }
                      }


                      IP属地:天津11楼2022-10-30 20:36
                      回复
                        累了的文本,但是我没看懂


                        IP属地:天津12楼2022-10-30 20:36
                        回复
                          case SPELL_DARK_RITUAL:
                          {
                          intdx, dy;
                          ATTACK_NAMES datk[4] = { ATTACK_SPELL_DARK_RITUAL_EAST,
                          ATTACK_SPELL_DARK_RITUAL_SOUTH,
                          ATTACK_SPELL_DARK_RITUAL_WEST,
                          ATTACK_SPELL_DARK_RITUAL_NORTH };
                          intdir;
                          intnumkilled = 0;
                          MOBREFmyself;
                          formatAndReport("%U <scatter> blood in a rough pentagram and start the unspeakable ritual.");
                          myself.setMob(this);
                          for (dir = 0; dir < 4; dir++)
                          {
                          getDirection(dir, dx, dy);
                          // Determine if their is an owned undead in this direction.
                          target = glbCurLevel->getMob(getX() + dx, getY() + dy);
                          if (!target)
                          continue;
                          // See if undead & owned.
                          if (target->defn().mobtype != MOBTYPE_UNDEAD)
                          continue;
                          if (!target->isSlave(this))
                          continue;
                          numkilled++;
                          // Transform the undead & empower the attack.
                          formatAndReport("%U <power> a deadly attack by consuming %MU.", target);
                          // Destroy the target.
                          glbCurLevel->unregisterMob(target);
                          target->triggerAsDeath(ATTACK_DARK_RITUAL_CONSUME, this, 0, false);
                          delete target;
                          // Apply the attack.
                          ourEffectAttack = datk[dir];
                          // Todo, maybe cone attack instead?
                          glbCurLevel->fireBall(getX() + dx * 2,
                          getY() + dy * 2,
                          1, true,
                          areaAttackCBStatic, &myself);
                          // Check if we died...
                          if (!myself.getMob() ||
                          myself.getMob() != this ||
                          myself.getMob()->hasIntrinsic(INTRINSIC_DEAD))
                          {
                          return true;
                          }
                          }
                          if (numkilled)
                          {
                          pietyCastSpell(spell);
                          if (numkilled == 4)
                          {
                          // Charge us up!
                          setTimedIntrinsic(0, INTRINSIC_LICHFORM, 2);
                          }
                          }
                          else
                          {
                          // No visual effect.
                          formatAndReport("With no willing victims, %R ritual has no effect.", target);
                          return true;
                          }
                          return true;
                          }


                          IP属地:天津13楼2022-10-30 20:39
                          回复
                            黑暗仪式 的释放条件是4个僵尸的引爆,可惜邪恶灵气只持续两个游戏回合


                            IP属地:天津14楼2022-10-30 20:40
                            回复
                              void
                              MOB::pietyHeal(int amount, bool self, bool enemy, bool vampiric)
                              {
                              // Necros are rewarded for healing enemies, as it is assumed
                              // one merely wants them to suffer longer.
                              // Otherwise, it isn't something one should be doing.
                              if (enemy || vampiric)
                              pietyGrant(GOD_NECRO, 1);
                              else
                              pietyGrant(GOD_NECRO, -5);
                              // Clerics are of two minds of enemy healing. It is a no-op
                              // as otherwise it would encourage uncleric like behaviour.
                              // We get massive bonuses for healing our pets.
                              if (!enemy)
                              {
                              // vampiric styles of healing are not appreciated.
                              if (vampiric)
                              pietyGrant(GOD_CLERIC, -1);
                              else
                              pietyGrant(GOD_CLERIC, self ? 1 : 3);
                              }
                              }


                              IP属地:天津15楼2022-10-30 20:55
                              回复